diff options
author | Sean Anderson <sean.anderson@seco.com> | 2021-08-26 22:43:23 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-08-27 17:34:04 +0300 |
commit | 3620a89b7d27138c716e5cf537a0bf6606a3a1b3 (patch) | |
tree | 443500d44280b51c3e2a596377a6aec21607e08c | |
parent | bb2853a6a421a052268eee00fd5d3f6b3504b2b1 (diff) | |
download | linux-3620a89b7d27138c716e5cf537a0bf6606a3a1b3.tar.xz |
tty: serial: uartlite: Use constants in early_uartlite_putc
Use the constants defined at the beginning of this file instead of
integer literals when accessing registers. This makes this code easier
to read, and obviates the need for some explanatory comments.
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Link: https://lore.kernel.org/r/20210826194323.3209227-1-sean.anderson@seco.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/serial/uartlite.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/tty/serial/uartlite.c b/drivers/tty/serial/uartlite.c index 047099b14cee..a1b9264498e2 100644 --- a/drivers/tty/serial/uartlite.c +++ b/drivers/tty/serial/uartlite.c @@ -561,16 +561,15 @@ static void early_uartlite_putc(struct uart_port *port, int c) * This limit is pretty arbitrary, unless we are at about 10 baud * we'll never timeout on a working UART. */ - unsigned retries = 1000000; - /* read status bit - 0x8 offset */ - while (--retries && (readl(port->membase + 8) & (1 << 3))) + + while (--retries && + (readl(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL)) ; /* Only attempt the iowrite if we didn't timeout */ - /* write to TX_FIFO - 0x4 offset */ if (retries) - writel(c & 0xff, port->membase + 4); + writel(c & 0xff, port->membase + ULITE_TX); } static void early_uartlite_write(struct console *console, |