summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2022-09-27 13:18:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-09-30 14:58:45 +0200
commitd8544c9c7cf77100be9340c61a9e3e88fe4bb12c (patch)
tree24c7ecd95900a8386fc49724e768a9884ae9eeab /drivers/tty/serial
parent8a1088116ba5ddbfcd69789b4a153733c9686cbb (diff)
downloadlinux-d8544c9c7cf77100be9340c61a9e3e88fe4bb12c.tar.bz2
tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar()
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>
Diffstat (limited to 'drivers/tty/serial')
-rw-r--r--drivers/tty/serial/lantiq.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/tty/serial/lantiq.c b/drivers/tty/serial/lantiq.c
index 6da1b7496c6c..ba9739af30ed 100644
--- a/drivers/tty/serial/lantiq.c
+++ b/drivers/tty/serial/lantiq.c
@@ -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);
}