mtd: nand: denali: return error code from nand_scan_ident/tail on error

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Dec 16 11:59:10 PST 2016


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=a227d4e4c356c9be84daba80be282ec56ba46c6c
Commit:     a227d4e4c356c9be84daba80be282ec56ba46c6c
Parent:     7ebb8d06781f87f5c6c6e6bae42ab44ba0fe9012
Author:     Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Wed Nov 9 13:35:28 2016 +0900
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Sat Nov 19 09:40:41 2016 +0100

    mtd: nand: denali: return error code from nand_scan_ident/tail on error
    
    The nand_scan_ident/tail() returns an appropriate error value when
    it fails.  Use it instead of the fixed -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/denali.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c
index f636ac4..bcb2bc7 100644
--- a/drivers/mtd/nand/denali.c
+++ b/drivers/mtd/nand/denali.c
@@ -1474,10 +1474,9 @@ int denali_init(struct denali_nand_info *denali)
 	 * this is the first stage in a two step process to register
 	 * with the nand subsystem
 	 */
-	if (nand_scan_ident(mtd, denali->max_banks, NULL)) {
-		ret = -ENXIO;
+	ret = nand_scan_ident(mtd, denali->max_banks, NULL);
+	if (ret)
 		goto failed_req_irq;
-	}
 
 	/* allocate the right size buffer now */
 	devm_kfree(denali->dev, denali->buf.buf);
@@ -1580,10 +1579,9 @@ int denali_init(struct denali_nand_info *denali)
 	denali->nand.ecc.write_oob = denali_write_oob;
 	denali->nand.erase = denali_erase;
 
-	if (nand_scan_tail(mtd)) {
-		ret = -ENXIO;
+	ret = nand_scan_tail(mtd);
+	if (ret)
 		goto failed_req_irq;
-	}
 
 	ret = mtd_device_register(mtd, NULL, 0);
 	if (ret) {



More information about the linux-mtd-cvs mailing list