mtd: nand: mediatek: return error code of nand_scan_ident/tail() on error

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


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f0dbe4aa35e73e4282d9446abb8900ab0636d483
Commit:     f0dbe4aa35e73e4282d9446abb8900ab0636d483
Parent:     b04bafca67dac3c390041bbcd694973e3d3f3b7d
Author:     Masahiro Yamada <yamada.masahiro at socionext.com>
AuthorDate: Fri Nov 4 19:43:02 2016 +0900
Committer:  Boris Brezillon <boris.brezillon at free-electrons.com>
CommitDate: Mon Nov 7 14:48:49 2016 +0100

    mtd: nand: mediatek: return error code of 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 error code -ENODEV.
    
    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/mtk_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c
index 5223a21..6c3eed3 100644
--- a/drivers/mtd/nand/mtk_nand.c
+++ b/drivers/mtd/nand/mtk_nand.c
@@ -1297,7 +1297,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 
 	ret = nand_scan_ident(mtd, nsels, NULL);
 	if (ret)
-		return -ENODEV;
+		return ret;
 
 	/* store bbt magic in page, cause OOB is not protected */
 	if (nand->bbt_options & NAND_BBT_USE_FLASH)
@@ -1323,7 +1323,7 @@ static int mtk_nfc_nand_chip_init(struct device *dev, struct mtk_nfc *nfc,
 
 	ret = nand_scan_tail(mtd);
 	if (ret)
-		return -ENODEV;
+		return ret;
 
 	ret = mtd_device_parse_register(mtd, NULL, NULL, NULL, 0);
 	if (ret) {



More information about the linux-mtd-cvs mailing list