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

mtd: nand: tmio: 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 -ENODEV.

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
43358c17 bbd4d03c

+3 -3
+3 -3
drivers/mtd/nand/tmio_nand.c
··· 435 435 nand_chip->waitfunc = tmio_nand_wait; 436 436 437 437 /* Scan to find existence of the device */ 438 - if (nand_scan(mtd, 1)) { 439 - retval = -ENODEV; 438 + retval = nand_scan(mtd, 1); 439 + if (retval) 440 440 goto err_irq; 441 - } 441 + 442 442 /* Register the partitions */ 443 443 retval = mtd_device_parse_register(mtd, NULL, NULL, 444 444 data ? data->partition : NULL,