diff options
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/nand_base.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index 3766682a0289..43214151b882 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c | |||
@@ -825,13 +825,8 @@ static void panic_nand_wait(struct mtd_info *mtd, struct nand_chip *chip, | |||
825 | static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) | 825 | static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) |
826 | { | 826 | { |
827 | 827 | ||
828 | unsigned long timeo = jiffies; | ||
829 | int status, state = chip->state; | 828 | int status, state = chip->state; |
830 | 829 | unsigned long timeo = (state == FL_ERASING ? 400 : 20); | |
831 | if (state == FL_ERASING) | ||
832 | timeo += (HZ * 400) / 1000; | ||
833 | else | ||
834 | timeo += (HZ * 20) / 1000; | ||
835 | 830 | ||
836 | led_trigger_event(nand_led_trigger, LED_FULL); | 831 | led_trigger_event(nand_led_trigger, LED_FULL); |
837 | 832 | ||
@@ -849,6 +844,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip) | |||
849 | if (in_interrupt() || oops_in_progress) | 844 | if (in_interrupt() || oops_in_progress) |
850 | panic_nand_wait(mtd, chip, timeo); | 845 | panic_nand_wait(mtd, chip, timeo); |
851 | else { | 846 | else { |
847 | timeo = jiffies + msecs_to_jiffies(timeo); | ||
852 | while (time_before(jiffies, timeo)) { | 848 | while (time_before(jiffies, timeo)) { |
853 | if (chip->dev_ready) { | 849 | if (chip->dev_ready) { |
854 | if (chip->dev_ready(mtd)) | 850 | if (chip->dev_ready(mtd)) |