/* In principle, this could be tied to an interrupt, but the adapter doesn't appear to be designed to support interrupts. We spin on the 0x80 ready bit.  */
static unsigned char ppa_wait(ppa_struct *dev)
/* In principle, this could be tied to an interrupt, but the adapter doesn't appear to be designed to support interrupts. We spin on the 0x80 ready bit.  */
static unsigned char ppa_wait(ppa_struct *dev)
{
	int k;
	unsigned short ppb = dev->base;
	unsigned char r;
	k = PPA_SPIN_TMO;
	for (r = r_str(ppb); ((r & 0xc0) != 0xc0) && (k); k--) {
		udelay(1);
		r = r_str(ppb);
	}
	if (k)
		return (r & 0xf0);
	ppa_fail(dev, DID_TIME_OUT);
	printk(KERN_WARNING "ppa timeout in ppa_wait\n");
	return 0;
}