/* Wait until Busy bit is off, or timeout (in ms) Return last status  */
static uchar ide_wait(int dev, ulong t)
/* Wait until Busy bit is off, or timeout (in ms) Return last status  */
static uchar ide_wait(int dev, ulong t)
{
	ulong delay = 10 * t;
	uchar c;
	while ((c = ide_inb(dev, ATA_STATUS)) & ATA_STAT_BUSY) {
		udelay(100);
		if (delay-- == 0)
			break;
	}
	return c;
}