]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar()
authorJiri Slaby <jslaby@suse.cz>
Tue, 27 Sep 2022 11:18:16 +0000 (13:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 30 Sep 2022 12:58:45 +0000 (14:58 +0200)
There is one more place where lqasc_tx_ready() can be used now:
lqasc_console_putchar(). So replace the open-coded variant by the
helper.

Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220927111819.18516-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/lantiq.c

index 6da1b7496c6c4ad4a561000a49b7c5af51a62a0e..ba9739af30ed093515211b76824196d616e05a04 100644 (file)
@@ -606,15 +606,12 @@ static const struct uart_ops lqasc_pops = {
 static void
 lqasc_console_putchar(struct uart_port *port, unsigned char ch)
 {
-       int fifofree;
-
        if (!port->membase)
                return;
 
-       do {
-               fifofree = (__raw_readl(port->membase + LTQ_ASC_FSTAT)
-                       & ASCFSTAT_TXFREEMASK) >> ASCFSTAT_TXFREEOFF;
-       } while (fifofree == 0);
+       while (!lqasc_tx_ready(port))
+               ;
+
        writeb(ch, port->membase + LTQ_ASC_TBUF);
 }