mtd: nand: cmx270: 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=546fe03fe349fd79df28ed8fed5efb1357110e28
Commit:     546fe03fe349fd79df28ed8fed5efb1357110e28
Parent:     0d0aa866ffa45471b12c9b9c5c48cbc02dcca59b
Author:     Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Fri Nov 4 19:42:50 2016 +0900
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Nov 7 14:48:41 2016 +0100

    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 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/cmx270_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/cmx270_nand.c b/drivers/mtd/nand/cmx270_nand.c
index 4913378..226ac0b 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;
 	}
 



More information about the linux-mtd-cvs mailing list