serial: uartps: Use cdns_uart_tx_empty in console_write
authorRaviteja Narayanam <raviteja.narayanam@xilinx.com>
Thu, 9 Apr 2020 06:26:03 +0000 (11:56 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 16 Apr 2020 14:15:14 +0000 (16:15 +0200)
Instead of accessing the registers and checking for tx_empty,
use cdns_uart_tx_empty in cdns_uart_console_write function.

Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com>
Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/1586413563-29125-3-git-send-email-raviteja.narayanam@xilinx.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/xilinx_uartps.c

index 0bf946b..042aa6f 100644 (file)
@@ -1233,9 +1233,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,
        writel(ctrl, port->membase + CDNS_UART_CR);
 
        uart_console_write(port, s, count, cdns_uart_console_putchar);
-       while ((readl(port->membase + CDNS_UART_SR) &
-                       (CDNS_UART_SR_TXEMPTY | CDNS_UART_SR_TACTIVE)) !=
-                       CDNS_UART_SR_TXEMPTY)
+       while (cdns_uart_tx_empty(port) != TIOCSER_TEMT)
                cpu_relax();
 
        /* restore interrupt state */