/* Wait for transmitter & holding register to empty  */
static void wait_for_xmitr(struct uart_8250_port *up, int bits)
/* Wait for transmitter & holding register to empty  */
static void wait_for_xmitr(struct uart_8250_port *up, int bits)
{
	unsigned int status, tmout = 10000;
	do {
		status = serial_in(up, UART_LSR);
		up->lsr_saved_flags |= status & LSR_SAVE_FLAGS;
		if (--tmout == 0)
			break;
		udelay(1);
	} while ((status & bits) != bits);
	if (up->port.flags & UPF_CONS_FLOW) {
		unsigned int tmout;
		for (tmout = 1000000; tmout; tmout--) {
			unsigned int msr = serial_in(up, UART_MSR);
			up->msr_saved_flags |= msr & MSR_SAVE_FLAGS;
			if (msr & UART_MSR_CTS)
				break;
			udelay(1);
			touch_nmi_watchdog();
		}
	}
}