diff options
Diffstat (limited to 'drivers/mtd/chips/sharp.c')
-rw-r--r-- | drivers/mtd/chips/sharp.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/mtd/chips/sharp.c b/drivers/mtd/chips/sharp.c index c3cf0f63bc93..2d26bdef82d5 100644 --- a/drivers/mtd/chips/sharp.c +++ b/drivers/mtd/chips/sharp.c | |||
@@ -4,7 +4,7 @@ | |||
4 | * Copyright 2000,2001 David A. Schleef <ds@schleef.org> | 4 | * Copyright 2000,2001 David A. Schleef <ds@schleef.org> |
5 | * 2000,2001 Lineo, Inc. | 5 | * 2000,2001 Lineo, Inc. |
6 | * | 6 | * |
7 | * $Id: sharp.c,v 1.14 2004/08/09 13:19:43 dwmw2 Exp $ | 7 | * $Id: sharp.c,v 1.16 2005/11/07 11:14:23 gleixner Exp $ |
8 | * | 8 | * |
9 | * Devices supported: | 9 | * Devices supported: |
10 | * LH28F016SCT Symmetrical block flash memory, 2Mx8 | 10 | * LH28F016SCT Symmetrical block flash memory, 2Mx8 |
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/mtd/cfi.h> | 31 | #include <linux/mtd/cfi.h> |
32 | #include <linux/delay.h> | 32 | #include <linux/delay.h> |
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/slab.h> | ||
34 | 35 | ||
35 | #define CMD_RESET 0xffffffff | 36 | #define CMD_RESET 0xffffffff |
36 | #define CMD_READ_ID 0x90909090 | 37 | #define CMD_READ_ID 0x90909090 |
@@ -214,7 +215,7 @@ static int sharp_probe_map(struct map_info *map,struct mtd_info *mtd) | |||
214 | /* This function returns with the chip->mutex lock held. */ | 215 | /* This function returns with the chip->mutex lock held. */ |
215 | static int sharp_wait(struct map_info *map, struct flchip *chip) | 216 | static int sharp_wait(struct map_info *map, struct flchip *chip) |
216 | { | 217 | { |
217 | __u16 status; | 218 | int status, i; |
218 | unsigned long timeo = jiffies + HZ; | 219 | unsigned long timeo = jiffies + HZ; |
219 | DECLARE_WAITQUEUE(wait, current); | 220 | DECLARE_WAITQUEUE(wait, current); |
220 | int adr = 0; | 221 | int adr = 0; |
@@ -227,13 +228,11 @@ retry: | |||
227 | map_write32(map,CMD_READ_STATUS,adr); | 228 | map_write32(map,CMD_READ_STATUS,adr); |
228 | chip->state = FL_STATUS; | 229 | chip->state = FL_STATUS; |
229 | case FL_STATUS: | 230 | case FL_STATUS: |
230 | status = map_read32(map,adr); | 231 | for(i=0;i<100;i++){ |
231 | //printk("status=%08x\n",status); | 232 | status = map_read32(map,adr); |
232 | 233 | if((status & SR_READY)==SR_READY) | |
233 | udelay(100); | 234 | break; |
234 | if((status & SR_READY)!=SR_READY){ | 235 | udelay(1); |
235 | //printk(".status=%08x\n",status); | ||
236 | udelay(100); | ||
237 | } | 236 | } |
238 | break; | 237 | break; |
239 | default: | 238 | default: |
@@ -460,12 +459,12 @@ static int sharp_do_wait_for_ready(struct map_info *map, struct flchip *chip, | |||
460 | remove_wait_queue(&chip->wq, &wait); | 459 | remove_wait_queue(&chip->wq, &wait); |
461 | 460 | ||
462 | //spin_lock_bh(chip->mutex); | 461 | //spin_lock_bh(chip->mutex); |
463 | 462 | ||
464 | if (signal_pending(current)){ | 463 | if (signal_pending(current)){ |
465 | ret = -EINTR; | 464 | ret = -EINTR; |
466 | goto out; | 465 | goto out; |
467 | } | 466 | } |
468 | 467 | ||
469 | } | 468 | } |
470 | ret = -ETIME; | 469 | ret = -ETIME; |
471 | out: | 470 | out: |
@@ -564,7 +563,7 @@ static int sharp_suspend(struct mtd_info *mtd) | |||
564 | static void sharp_resume(struct mtd_info *mtd) | 563 | static void sharp_resume(struct mtd_info *mtd) |
565 | { | 564 | { |
566 | printk("sharp_resume()\n"); | 565 | printk("sharp_resume()\n"); |
567 | 566 | ||
568 | } | 567 | } |
569 | 568 | ||
570 | static void sharp_destroy(struct mtd_info *mtd) | 569 | static void sharp_destroy(struct mtd_info *mtd) |