/* Wait for command done. This is a helper function for nand_wait used when we are in interrupt context. May happen when in panic and trying to write an oops trough mtdoops.  */
static void panic_nand_wait(struct mtd_info *mtd, struct nand_chip *chip, unsigned long timeo)
/* Wait for command done. This is a helper function for nand_wait used when we are in interrupt context. May happen when in panic and trying to write an oops trough mtdoops.  */
static void panic_nand_wait(struct mtd_info *mtd, struct nand_chip *chip, unsigned long timeo)
{
	int i;
	for (i = 0; i < timeo; i++) {
		if (chip->dev_ready) {
			if (chip->dev_ready(mtd))
				break;
		} else {
			if (chip->read_byte(mtd) & NAND_STATUS_READY)
				break;
		}
		mdelay(1);
        }
}