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

mtd: nand: pasemi: 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
4e5af27e 6c34ad7d

+2 -3
+2 -3
drivers/mtd/nand/pasemi_nand.c
··· 156 156 chip->bbt_options = NAND_BBT_USE_FLASH; 157 157 158 158 /* Scan to find existence of the device */ 159 - if (nand_scan(pasemi_nand_mtd, 1)) { 160 - err = -ENXIO; 159 + err = nand_scan(pasemi_nand_mtd, 1); 160 + if (err) 161 161 goto out_lpc; 162 - } 163 162 164 163 if (mtd_device_register(pasemi_nand_mtd, NULL, 0)) { 165 164 dev_err(dev, "Unable to register MTD device\n");