Skip to content

Commit 3620a89

Browse files
sean-anderson-secogregkh
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent bb2853a commit 3620a89

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/tty/serial/uartlite.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,15 @@ static void early_uartlite_putc(struct uart_port *port, int c)
561561
* This limit is pretty arbitrary, unless we are at about 10 baud
562562
* we'll never timeout on a working UART.
563563
*/
564-
565564
unsigned retries = 1000000;
566-
/* read status bit - 0x8 offset */
567-
while (--retries && (readl(port->membase + 8) & (1 << 3)))
565+
566+
while (--retries &&
567+
(readl(port->membase + ULITE_STATUS) & ULITE_STATUS_TXFULL))
568568
;
569569

570570
/* Only attempt the iowrite if we didn't timeout */
571-
/* write to TX_FIFO - 0x4 offset */
572571
if (retries)
573-
writel(c & 0xff, port->membase + 4);
572+
writel(c & 0xff, port->membase + ULITE_TX);
574573
}
575574

576575
static void early_uartlite_write(struct console *console,

0 commit comments

Comments
 (0)