/* Wait for the ready pin after a command, and warn if a timeout occurs.  */
void nand_wait_ready(struct mtd_info *mtd)
/* Wait for the ready pin after a command, and warn if a timeout occurs.  */
void nand_wait_ready(struct mtd_info *mtd)
{
	struct nand_chip *chip = mtd_to_nand(mtd);
	u32 timeo = (CONFIG_SYS_HZ * 400) / 1000;
	u32 time_start;
	time_start = get_timer(0);
	while (get_timer(time_start) < timeo) {
		if (chip->dev_ready)
			if (chip->dev_ready(mtd))
				break;
	}
	if (!chip->dev_ready(mtd))
		pr_warn("timeout while waiting for chip to become ready\n");
}