mtd: nand: mpc5121: return error code of nand_scan() on error
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Dec 16 11:59:05 PST 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=bbd4d03c56083069cf0808681bd301cf31701fbd
Commit: bbd4d03c56083069cf0808681bd301cf31701fbd
Parent: 408bf51e92752d084d82d21e2c1f838d0ecc5eea
Author: Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Fri Nov 4 19:42:53 2016 +0900
Committer: Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Nov 7 14:48:43 2016 +0100
mtd: nand: mpc5121: 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 at socionext.com>
Reviewed-by: Marek Vasut <marek.vasut at gmail.com>
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
---
drivers/mtd/nand/mpc5121_nfc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/mpc5121_nfc.c b/drivers/mtd/nand/mpc5121_nfc.c
index 7eacb2f..6d6eaed 100644
--- a/drivers/mtd/nand/mpc5121_nfc.c
+++ b/drivers/mtd/nand/mpc5121_nfc.c
@@ -777,9 +777,9 @@ static int mpc5121_nfc_probe(struct platform_device *op)
}
/* Detect NAND chips */
- if (nand_scan(mtd, be32_to_cpup(chips_no))) {
+ retval = nand_scan(mtd, be32_to_cpup(chips_no));
+ if (retval) {
dev_err(dev, "NAND Flash not found !\n");
- retval = -ENXIO;
goto error;
}
More information about the linux-mtd-cvs
mailing list