mtd/drivers/mtd/chips sharp.c,1.14,1.15
tpoynor at infradead.org
tpoynor at infradead.org
Tue Aug 2 16:36:09 EDT 2005
Update of /home/cvs/mtd/drivers/mtd/chips
In directory phoenix.infradead.org:/tmp/cvs-serv3239/drivers/mtd/chips
Modified Files:
sharp.c
Log Message:
[MTD] Pre-CFI Sharp chip driver: Some speedups and cleanups
Remove useless udelay(100) after status value already read. Poll
for status OK with reduced udelay if not immediate OK status return.
Fix read and compare of 32-bit status value using 16-bit variable.
Include slab.h since kmalloc/kfree are called.
Index: sharp.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/sharp.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- sharp.c 9 Aug 2004 13:19:43 -0000 1.14
+++ sharp.c 2 Aug 2005 20:36:05 -0000 1.15
@@ -31,6 +31,7 @@
#include <linux/mtd/cfi.h>
#include <linux/delay.h>
#include <linux/init.h>
+#include <linux/slab.h>
#define CMD_RESET 0xffffffff
#define CMD_READ_ID 0x90909090
@@ -214,7 +215,7 @@
/* This function returns with the chip->mutex lock held. */
static int sharp_wait(struct map_info *map, struct flchip *chip)
{
- __u16 status;
+ int status, i;
unsigned long timeo = jiffies + HZ;
DECLARE_WAITQUEUE(wait, current);
int adr = 0;
@@ -227,13 +228,11 @@
map_write32(map,CMD_READ_STATUS,adr);
chip->state = FL_STATUS;
case FL_STATUS:
- status = map_read32(map,adr);
-//printk("status=%08x\n",status);
-
- udelay(100);
- if((status & SR_READY)!=SR_READY){
-//printk(".status=%08x\n",status);
- udelay(100);
+ for(i=0;i<100;i++){
+ status = map_read32(map,adr);
+ if((status & SR_READY)==SR_READY)
+ break;
+ udelay(1);
}
break;
default:
More information about the linux-mtd-cvs
mailing list