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

    mtd: nand: cs553x: 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/cs553x_nand.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c
index a65e4e0..594b286 100644
--- a/drivers/mtd/nand/cs553x_nand.c
+++ b/drivers/mtd/nand/cs553x_nand.c
@@ -242,10 +242,9 @@ static int __init cs553x_init_one(int cs, int mmio, unsigned long adr)
 	}
 
 	/* Scan to find existence of the device */
-	if (nand_scan(new_mtd, 1)) {
-		err = -ENXIO;
+	err = nand_scan(new_mtd, 1);
+	if (err)
 		goto out_free;
-	}
 
 	cs553x_mtd[cs] = new_mtd;
 	goto out;



More information about the linux-mtd-cvs mailing list