Patchwork [3/5] mtd: nand-gpio: Use default dev_ready function if RDY-pin is missing in configuration

login
register
mail settings
Submitter Alexander Shiyan
Date April 13, 2013, 7:06 a.m.
Message ID <1365836798-29035-3-git-send-email-shc_work@mail.ru>
Download mbox | patch
Permalink /patch/236298/
State New
Headers show

Comments

Alexander Shiyan - April 13, 2013, 7:06 a.m.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
 drivers/mtd/nand/gpio.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Patch

diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c
index 3f2cdae..49beecd 100644
--- a/drivers/mtd/nand/gpio.c
+++ b/drivers/mtd/nand/gpio.c
@@ -135,10 +135,7 @@  static int gpio_nand_devready(struct mtd_info *mtd)
 {
 	struct gpiomtd *gpiomtd = gpio_nand_getpriv(mtd);
 
-	if (gpio_is_valid(gpiomtd->plat.gpio_rdy))
-		return gpio_get_value(gpiomtd->plat.gpio_rdy);
-
-	return 1;
+	return gpio_get_value(gpiomtd->plat.gpio_rdy);
 }
 
 #ifdef CONFIG_OF
@@ -297,6 +294,7 @@  static int gpio_nand_probe(struct platform_device *pdev)
 		if (ret)
 			return ret;
 		gpio_direction_input(gpiomtd->plat.gpio_rdy);
+		chip->dev_ready = gpio_nand_devready;
 	}
 
 
@@ -305,7 +303,6 @@  static int gpio_nand_probe(struct platform_device *pdev)
 	chip->options		= gpiomtd->plat.options;
 	chip->chip_delay	= gpiomtd->plat.chip_delay;
 	chip->cmd_ctrl		= gpio_nand_cmd_ctrl;
-	chip->dev_ready		= gpio_nand_devready;
 
 	if (chip->options & NAND_BUSWIDTH_16) {
 		chip->read_buf	= gpio_nand_readbuf16;