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>
This commit is contained in:
Masahiro Yamada 2016-11-04 19:42:51 +09:00 committed by Boris Brezillon
parent 546fe03fe3
commit 29453ba40b

View File

@ -242,10 +242,9 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
}
/* Scan to find existence of the device */
if (nand_scan(new_mtd, 1)) {
err = -ENXIO;
err = nand_scan(new_mtd, 1);
if (err)
goto out_free;
}
cs553x_mtd[cs] = new_mtd;
goto out;