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

mtd: nand: cmx270: 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
546fe03f 0d0aa866

+2 -2
+2 -2
drivers/mtd/nand/cmx270_nand.c
··· 195 195 this->write_buf = cmx270_write_buf; 196 196 197 197 /* Scan to find existence of the device */ 198 - if (nand_scan (cmx270_nand_mtd, 1)) { 198 + ret = nand_scan(cmx270_nand_mtd, 1); 199 + if (ret) { 199 200 pr_notice("No NAND device\n"); 200 - ret = -ENXIO; 201 201 goto err_scan; 202 202 } 203 203