mtd: nand: plat_nand: 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:57 +09:00 committed by Boris Brezillon
parent 4e5af27e2a
commit ce2eaca7eb
1 changed files with 2 additions and 3 deletions

View File

@ -86,10 +86,9 @@ static int plat_nand_probe(struct platform_device *pdev)
}
/* Scan to find existence of the device */
if (nand_scan(mtd, pdata->chip.nr_chips)) {
err = -ENXIO;
err = nand_scan(mtd, pdata->chip.nr_chips);
if (err)
goto out;
}
part_types = pdata->chip.part_probe_types;