summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-11-04 19:43:02 +0900
committerBoris Brezillon <boris.brezillon@free-electrons.com>2016-11-07 14:48:49 +0100
commitf0dbe4aa35e73e4282d9446abb8900ab0636d483 (patch)
tree271df6e8c28fff98759b2e63b2a6a28a02234041 /drivers
parentb04bafca67dac3c390041bbcd694973e3d3f3b7d (diff)
downloadtalos-obmc-linux-f0dbe4aa35e73e4282d9446abb8900ab0636d483.tar.gz
talos-obmc-linux-f0dbe4aa35e73e4282d9446abb8900ab0636d483.zip
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@socionext.com> Reviewed-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/mtk_nand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/nand/mtk_nand.c b/drivers/mtd/nand/mtk_nand.c
index 5223a2182ee4..6c3eed3c2094 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) {
OpenPOWER on IntegriCloud