[PATCH v4 3/4] mtd: nand: gpio: Return real nand_scan() error code on fail
Alexander Shiyan
shc_work at mail.ru
Fri Aug 16 03:20:33 EDT 2013
Signed-off-by: Alexander Shiyan <shc_work at mail.ru>
---
drivers/mtd/nand/gpio.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 98cc714..a9102a9 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 && !dev_get_platdata(&pdev->dev))
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,
--
1.8.1.5
More information about the linux-mtd
mailing list