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

mtd: nand: cs553x: 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
29453ba4 546fe03f

+2 -3
+2 -3
drivers/mtd/nand/cs553x_nand.c
··· 242 242 } 243 243 244 244 /* Scan to find existence of the device */ 245 - if (nand_scan(new_mtd, 1)) { 246 - err = -ENXIO; 245 + err = nand_scan(new_mtd, 1); 246 + if (err) 247 247 goto out_free; 248 - } 249 248 250 249 cs553x_mtd[cs] = new_mtd; 251 250 goto out;