summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/cmx270_nand.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-11-04 19:42:50 +0900
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-11-07 14:48:41 +0100
commit546fe03fe349fd79df28ed8fed5efb1357110e28 (patch)
tree952f139d66af10c479e78d7a58a429a12ee637e6 /drivers/mtd/nand/cmx270_nand.c
parent0d0aa866ffa45471b12c9b9c5c48cbc02dcca59b (diff)
mtd: nand: cmx270: 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/cmx270_nand.c')
-rw-r--r--drivers/mtd/nand/cmx270_nand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index 49133783ca53..226ac0bcafc6 100644
--- a/drivers/mtd/nand/cmx270_nand.c
+++ b/drivers/mtd/nand/cmx270_nand.c
@@ -195,9 +195,9 @@ static int __init cmx270_init(void)
this->write_buf = cmx270_write_buf;
/* Scan to find existence of the device */
- if (nand_scan (cmx270_nand_mtd, 1)) {
+ ret = nand_scan(cmx270_nand_mtd, 1);
+ if (ret) {
pr_notice("No NAND device\n");
- ret = -ENXIO;
goto err_scan;
}