status = map_read32(map,adr);   udelay(100); if((status & SR_READY)!=SR_READY){  udelay(100); 
for(i=0;i<100;i++){ status = map_read32(map,adr); if((status & SR_READY)==SR_READY) break; udelay(1); 
static int sharp_wait(struct map_info *map, struct flchip *chip){	__u16 status;	unsigned long timeo = jiffies + HZ;	DECLARE_WAITQUEUE(wait, current);	int adr = 0;retry:	spin_lock_bh(chip->mutex);	switch(chip->state){	case FL_READY:		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);		}		break;	default:		printk("Waiting for chip\n");		set_current_state(TASK_INTERRUPTIBLE);		add_wait_queue(&chip->wq, &wait);		spin_unlock_bh(chip->mutex);		schedule();		remove_wait_queue(&chip->wq, &wait);		if(signal_pending(current))			return -EINTR;		timeo = jiffies + HZ;		goto retry;	}	map_write32(map,CMD_RESET, adr);	chip->state = FL_READY;	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/1da2c9a638f8af7be3daf1fa8dbd087b3284d16e/sharp.c/buggy/drivers/mtd/chips/sharp.c