diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/devices/m25p80.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mtd/devices/m25p80.c b/drivers/mtd/devices/m25p80.c index 8185b1f3e5e6..dfadef84c052 100644 --- a/drivers/mtd/devices/m25p80.c +++ b/drivers/mtd/devices/m25p80.c | |||
@@ -54,7 +54,7 @@ | |||
54 | #define SR_SRWD 0x80 /* SR write protect */ | 54 | #define SR_SRWD 0x80 /* SR write protect */ |
55 | 55 | ||
56 | /* Define max times to check status register before we give up. */ | 56 | /* Define max times to check status register before we give up. */ |
57 | #define MAX_READY_WAIT_COUNT 100000 | 57 | #define MAX_READY_WAIT_COUNT 1000000 |
58 | #define CMD_SIZE 4 | 58 | #define CMD_SIZE 4 |
59 | 59 | ||
60 | #ifdef CONFIG_M25PXX_USE_FAST_READ | 60 | #ifdef CONFIG_M25PXX_USE_FAST_READ |
@@ -246,10 +246,12 @@ static int m25p80_erase(struct mtd_info *mtd, struct erase_info *instr) | |||
246 | mutex_lock(&flash->lock); | 246 | mutex_lock(&flash->lock); |
247 | 247 | ||
248 | /* whole-chip erase? */ | 248 | /* whole-chip erase? */ |
249 | if (len == flash->mtd.size && erase_chip(flash)) { | 249 | if (len == flash->mtd.size) { |
250 | instr->state = MTD_ERASE_FAILED; | 250 | if (erase_chip(flash)) { |
251 | mutex_unlock(&flash->lock); | 251 | instr->state = MTD_ERASE_FAILED; |
252 | return -EIO; | 252 | mutex_unlock(&flash->lock); |
253 | return -EIO; | ||
254 | } | ||
253 | 255 | ||
254 | /* REVISIT in some cases we could speed up erasing large regions | 256 | /* REVISIT in some cases we could speed up erasing large regions |
255 | * by using OPCODE_SE instead of OPCODE_BE_4K. We may have set up | 257 | * by using OPCODE_SE instead of OPCODE_BE_4K. We may have set up |