linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar()
@ 2022-09-27 11:18 Jiri Slaby
  2022-09-27 11:18 ` [PATCH 2/4] tty: serial: use FIELD_GET() in lqasc_tx_ready() Jiri Slaby
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Jiri Slaby @ 2022-09-27 11:18 UTC (permalink / raw)
  To: gregkh; +Cc: linux-serial, linux-kernel, Jiri Slaby, Ilpo Järvinen

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>
---
 drivers/tty/serial/lantiq.c | 9 +++------
 1 file 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);
 }
 
-- 
2.37.3


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-09-28 10:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-27 11:18 [PATCH 1/4] tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar() Jiri Slaby
2022-09-27 11:18 ` [PATCH 2/4] tty: serial: use FIELD_GET() in lqasc_tx_ready() Jiri Slaby
2022-09-27 11:48   ` Ilpo Järvinen
2022-09-27 11:18 ` [PATCH 3/4] tty: serial: unify TX space reads under altera_jtaguart_tx_space() Jiri Slaby
2022-09-27 15:04   ` Tobias Klauser
2022-09-28 10:26   ` Ilpo Järvinen
2022-09-27 11:18 ` [PATCH 4/4] tty: serial: do unlock on a common path in altera_jtaguart_console_putc() Jiri Slaby
2022-09-27 14:59   ` Tobias Klauser
2022-09-28 10:27   ` Ilpo Järvinen
2022-09-27 11:47 ` [PATCH 1/4] tty: serial: extend lqasc_tx_ready() to lqasc_console_putchar() Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).