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-Tag: v5.15~12218^2~4^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce2eaca7ebf13006cb992ed2f8ce46aaf8724c71;p=platform%2Fkernel%2Flinux-starfive.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 415a53a..791de3e 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;