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:
parent
4e5af27e2a
commit
ce2eaca7eb
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue