/* Wait for device to send output char and flush any input char.  */
static int ct82c170_wait(void)
/* Wait for device to send output char and flush any input char.  */
static int ct82c170_wait(void)
{
	int timeout = 60000;
	while ((inb(CT82C710_STATUS) & (CT82C710_RX_FULL | CT82C710_TX_IDLE | CT82C710_DEV_IDLE))
		       != (CT82C710_DEV_IDLE | CT82C710_TX_IDLE) && timeout) {
		if (inb_p(CT82C710_STATUS) & CT82C710_RX_FULL) inb_p(CT82C710_DATA);
		udelay(1);
		timeout--;
	}
	return !timeout;
}