From: Masahiro Yamada Date: Fri, 4 Nov 2016 10:42:57 +0000 (+0900) Subject: mtd: nand: plat_nand: return error code of nand_scan() on error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ce2eaca7ebf13006cb992ed2f8ce46aaf8724c71;p=linux-beck.git mtd: nand: plat_nand: return error code of nand_scan() on error 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 Reviewed-by: Marek Vasut Signed-off-by: Boris Brezillon --- diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c index 415a53a0deeb..791de3e4bbb6 100644 --- a/drivers/mtd/nand/plat_nand.c +++ b/drivers/mtd/nand/plat_nand.c @@ -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;