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

mtd: nand: orion: 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
6c34ad7d 43358c17

+2 -3
+2 -3
drivers/mtd/nand/orion_nand.c
··· 155 155 clk_put(clk); 156 156 } 157 157 158 - if (nand_scan(mtd, 1)) { 159 - ret = -ENXIO; 158 + ret = nand_scan(mtd, 1); 159 + if (ret) 160 160 goto no_dev; 161 - } 162 161 163 162 mtd->name = "orion_nand"; 164 163 ret = mtd_device_register(mtd, board->parts, board->nr_parts);