Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <yamada.masahiro@socionext.com>
Reviewed-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>

authored by

Masahiro Yamada and committed by
Boris Brezillon
ce2eaca7 4e5af27e

+2 -3
+2 -3
drivers/mtd/nand/plat_nand.c
··· 86 86 } 87 87 88 88 /* Scan to find existence of the device */ 89 - if (nand_scan(mtd, pdata->chip.nr_chips)) { 90 - err = -ENXIO; 89 + err = nand_scan(mtd, pdata->chip.nr_chips); 90 + if (err) 91 91 goto out; 92 - } 93 92 94 93 part_types = pdata->chip.part_probe_types; 95 94