summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/plat_nand.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-11-04 19:42:57 +0900
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-11-07 14:48:45 +0100
commitce2eaca7ebf13006cb992ed2f8ce46aaf8724c71 (patch)
tree80bab8f2ecbbfcb11dcb41bea3158de2a21b15c8 /drivers/mtd/nand/plat_nand.c
parent4e5af27e2a3a393558936b82fece1942ec49f534 (diff)
downloadblackbird-op-linux-ce2eaca7ebf13006cb992ed2f8ce46aaf8724c71.tar.gz
blackbird-op-linux-ce2eaca7ebf13006cb992ed2f8ce46aaf8724c71.zip
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>
Diffstat (limited to 'drivers/mtd/nand/plat_nand.c')
-rw-r--r--drivers/mtd/nand/plat_nand.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
index 415a53a0deeb..791de3e4bbb6 100644
--- a/drivers/mtd/nand/plat_nand.c
+++ b/drivers/mtd/nand/plat_nand.c
@@ -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;
OpenPOWER on IntegriCloud