diff options
author | Stefan Roese <sr@denx.de> | 2008-01-05 16:43:25 +0100 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2008-08-12 11:31:22 -0500 |
commit | 12072264528eba33737bc9674e19f0e925ffda23 (patch) | |
tree | 87f18a3f1166051f8c7e9be56544ccc5d4e8da98 /drivers/mtd/nand/nand_base.c | |
parent | 9ad754fef5053144daed3b007adaf1c9bec654c9 (diff) |
NAND: Change nand_wait_ready() to not call nand_wait()
This patch changes nand_wait_ready() to not just call nand_wait(),
since this will send a new command to the NAND chip. We just want to
wait for the chip to become ready here.
Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 4b1c564f75..f577ed6294 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -489,7 +489,16 @@ EXPORT_SYMBOL_GPL(nand_wait_ready); void nand_wait_ready(struct mtd_info *mtd) { struct nand_chip *chip = mtd->priv; - nand_wait(mtd, chip); + u32 timeo = (CFG_HZ * 20) / 1000; + + reset_timer(); + + /* wait until command is processed or timeout occures */ + while (get_timer(0) < timeo) { + if (chip->dev_ready) + if (chip->dev_ready(mtd)) + break; + } } #endif |