From: Alexander Shiyan Date: Mon, 6 May 2013 13:53:49 +0000 (+0400) Subject: mtd: nand-gpio: Use default dev_ready function if RDY is missing in configuration X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c85d32d56859bb01f775e12771150dc47a7b03ba;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git mtd: nand-gpio: Use default dev_ready function if RDY is missing in configuration Signed-off-by: Alexander Shiyan Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- diff --git a/drivers/mtd/nand/gpio.c b/drivers/mtd/nand/gpio.c index c35f46e81d1c..8f102d162126 100644 --- a/drivers/mtd/nand/gpio.c +++ b/drivers/mtd/nand/gpio.c @@ -136,10 +136,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 @@ -307,6 +304,7 @@ static int gpio_nand_probe(struct platform_device *dev) if (ret) return ret; gpio_direction_input(gpiomtd->plat.gpio_rdy); + this->dev_ready = gpio_nand_devready; } this->IO_ADDR_W = this->IO_ADDR_R; @@ -316,7 +314,6 @@ static int gpio_nand_probe(struct platform_device *dev) /* install our routines */ this->cmd_ctrl = gpio_nand_cmd_ctrl; - this->dev_ready = gpio_nand_devready; if (this->options & NAND_BUSWIDTH_16) { this->read_buf = gpio_nand_readbuf16;