mtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue Jan 28 00:59:02 EST 2014


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=56704d857ac9a1044ec58cfe0ff95dc6bdbd9d58
Commit:     56704d857ac9a1044ec58cfe0ff95dc6bdbd9d58
Parent:     55d9fd6e94caf5f30d027f49bd0a4955bc6b3a8c
Author:     Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
AuthorDate: Thu Nov 14 18:25:27 2013 -0300
Committer:  Brian Norris <computersforpeace at gmail.com>
CommitDate: Fri Jan 3 11:22:11 2014 -0800

    mtd: nand: pxa3xx: Use waitfunc() to wait for the device to be ready
    
    In pxa3xx_nand_sensing() instead of simply using info->is_ready
    after issuing a command, the correct way of checking is to wait
    for the device to be ready through the chip's waitfunc().
    
    Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
    Tested-by: Daniel Mack <zonque at gmail.com>
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
 drivers/mtd/nand/pxa3xx_nand.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c
index b3c5c69..a30116b 100644
--- a/drivers/mtd/nand/pxa3xx_nand.c
+++ b/drivers/mtd/nand/pxa3xx_nand.c
@@ -1036,10 +1036,11 @@ static int pxa3xx_nand_sensing(struct pxa3xx_nand_info *info)
 		return ret;
 
 	chip->cmdfunc(mtd, NAND_CMD_RESET, 0, 0);
-	if (!info->need_wait)
-		return 0;
+	ret = chip->waitfunc(mtd, chip);
+	if (ret & NAND_STATUS_FAIL)
+		return -ENODEV;
 
-	return -ENODEV;
+	return 0;
 }
 
 static int pxa3xx_nand_scan(struct mtd_info *mtd)



More information about the linux-mtd-cvs mailing list