/* Wait for the ready pin, after a command The timeout is catched later.  */
void nand_wait_ready(struct mtd_info *mtd)
/* Wait for the ready pin, after a command The timeout is catched later.  */
void nand_wait_ready(struct mtd_info *mtd)
{
	struct nand_chip *chip = mtd->priv;
	unsigned long timeo = jiffies + 2;
	if (in_interrupt() || oops_in_progress)
		return panic_nand_wait_ready(mtd, 400);
	led_trigger_event(nand_led_trigger, LED_FULL);
	do {
		if (chip->dev_ready(mtd))
			break;
		touch_softlockup_watchdog();
	} while (time_before(jiffies, timeo));
	led_trigger_event(nand_led_trigger, LED_OFF);
}