mtd: nand: plat_nand: return error code of nand_scan() on error
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 4 Nov 2016 10:42:57 +0000 (19:42 +0900)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Mon, 7 Nov 2016 13:48:45 +0000 (14:48 +0100)
The nand_scan() returns an appropriate error value when it fails.
Use it instead of the fixed error code -ENXIO.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
drivers/mtd/nand/plat_nand.c

index 415a53a0deeb306bb5baeaf3f5ad6638fd41d103..791de3e4bbb681392a50c510883f00c95cdd47cd 100644 (file)
@@ -86,10 +86,9 @@ static int plat_nand_probe(struct platform_device *pdev)
        }
 
        /* Scan to find existence of the device */
-       if (nand_scan(mtd, pdata->chip.nr_chips)) {
-               err = -ENXIO;
+       err = nand_scan(mtd, pdata->chip.nr_chips);
+       if (err)
                goto out;
-       }
 
        part_types = pdata->chip.part_probe_types;