Patchwork [v3,3/4] mtd: nand: gpio: Return real nand_scan() error code on fail

login
register
mail settings
Submitter Alexander Shiyan
Date Aug. 6, 2013, 8:59 a.m.
Message ID <1375779544-510-3-git-send-email-shc_work@mail.ru>
Download mbox | patch
Permalink /patch/264925/
State New
Headers show

Comments

Alexander Shiyan - Aug. 6, 2013, 8:59 a.m.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/nand/gpio.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch

diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 203db72..d4c123e 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -215,7 +215,7 @@  static int gpio_nand_probe(struct platform_device *pdev)
 	struct nand_chip *chip;
 	struct resource *res;
 	struct mtd_part_parser_data ppdata = {};
-	int ret = 0;
+	int ret;
 
 	if (!pdev->dev.of_node && !pdev->dev.platform_data)
 		return -EINVAL;
@@ -291,10 +291,9 @@  static int gpio_nand_probe(struct platform_device *pdev)
 
 	gpio_nand_set_wp(gpiomtd, 1);
 
-	if (nand_scan(&gpiomtd->mtd_info, 1)) {
-		ret = -ENXIO;
+	ret = nand_scan(&gpiomtd->mtd_info, 1);
+	if (ret)
 		goto err_wp;
-	}
 
 	if (gpiomtd->plat.adjust_parts)
 		gpiomtd->plat.adjust_parts(&gpiomtd->plat,