dw8250_tx_wait_empty() uses direct byte I/O accessor while some ports might prefer to use word, long or ever quad word access to the register. Unify the function in a way how it's done in dw8250_check_lsr(). Cc: Joshua Scott <joshua.scott@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> --- drivers/tty/serial/8250/8250_dw.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 6fcdb90f616a..4ad67707a2cd 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -121,12 +121,13 @@ static void dw8250_check_lcr(struct uart_port *p, int value) } /* Returns once the transmitter is empty or we run out of retries */ -static void dw8250_tx_wait_empty(struct uart_port *p, int tries) +static void dw8250_tx_wait_empty(struct uart_port *p) { - unsigned int lsr; + int tries = 1000; while (tries--) { - lsr = readb (p->membase + (UART_LSR << p->regshift)); + unsigned int lcr = p->serial_in(p, UART_LCR); + if (lsr & UART_LSR_TEMT) break; udelay (10); @@ -139,7 +140,7 @@ static void dw8250_serial_out(struct uart_port *p, int offset, int value) /* Allow the TX to drain before we reconfigure */ if (offset == UART_LCR) - dw8250_tx_wait_empty(p, 1000); + dw8250_tx_wait_empty(p); writeb(value, p->membase + (offset << p->regshift)); -- 2.16.1 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html