All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jslaby@suse.cz>, Vladimir Zapolskiy <vz@mleia.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] tty: serial: lpc32xx_hs: use serial_lpc32xx_stop_tx() helper
Date: Thu, 24 Feb 2022 12:10:28 +0100	[thread overview]
Message-ID: <20220224111028.20917-6-jslaby@suse.cz> (raw)
In-Reply-To: <20220224111028.20917-1-jslaby@suse.cz>

Instead of open-coding what serial_lpc32xx_stop_tx() already does, call
it in __serial_lpc32xx_tx() directly.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/tty/serial/lpc32xx_hs.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index b7b489c68c36..93140cac1ca1 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -276,10 +276,11 @@ static void __serial_lpc32xx_rx(struct uart_port *port)
 	tty_flip_buffer_push(tport);
 }
 
+static void serial_lpc32xx_stop_tx(struct uart_port *port);
+
 static void __serial_lpc32xx_tx(struct uart_port *port)
 {
 	struct circ_buf *xmit = &port->state->xmit;
-	unsigned int tmp;
 
 	if (port->x_char) {
 		writel((u32)port->x_char, LPC32XX_HSUART_FIFO(port->membase));
@@ -306,11 +307,8 @@ static void __serial_lpc32xx_tx(struct uart_port *port)
 		uart_write_wakeup(port);
 
 exit_tx:
-	if (uart_circ_empty(xmit)) {
-		tmp = readl(LPC32XX_HSUART_CTRL(port->membase));
-		tmp &= ~LPC32XX_HSU_TX_INT_EN;
-		writel(tmp, LPC32XX_HSUART_CTRL(port->membase));
-	}
+	if (uart_circ_empty(xmit))
+		serial_lpc32xx_stop_tx(port);
 }
 
 static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
-- 
2.35.1


WARNING: multiple messages have this Message-ID (diff)
From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jiri Slaby <jslaby@suse.cz>, Vladimir Zapolskiy <vz@mleia.com>,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] tty: serial: lpc32xx_hs: use serial_lpc32xx_stop_tx() helper
Date: Thu, 24 Feb 2022 12:10:28 +0100	[thread overview]
Message-ID: <20220224111028.20917-6-jslaby@suse.cz> (raw)
In-Reply-To: <20220224111028.20917-1-jslaby@suse.cz>

Instead of open-coding what serial_lpc32xx_stop_tx() already does, call
it in __serial_lpc32xx_tx() directly.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Vladimir Zapolskiy <vz@mleia.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/tty/serial/lpc32xx_hs.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index b7b489c68c36..93140cac1ca1 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -276,10 +276,11 @@ static void __serial_lpc32xx_rx(struct uart_port *port)
 	tty_flip_buffer_push(tport);
 }
 
+static void serial_lpc32xx_stop_tx(struct uart_port *port);
+
 static void __serial_lpc32xx_tx(struct uart_port *port)
 {
 	struct circ_buf *xmit = &port->state->xmit;
-	unsigned int tmp;
 
 	if (port->x_char) {
 		writel((u32)port->x_char, LPC32XX_HSUART_FIFO(port->membase));
@@ -306,11 +307,8 @@ static void __serial_lpc32xx_tx(struct uart_port *port)
 		uart_write_wakeup(port);
 
 exit_tx:
-	if (uart_circ_empty(xmit)) {
-		tmp = readl(LPC32XX_HSUART_CTRL(port->membase));
-		tmp &= ~LPC32XX_HSU_TX_INT_EN;
-		writel(tmp, LPC32XX_HSUART_CTRL(port->membase));
-	}
+	if (uart_circ_empty(xmit))
+		serial_lpc32xx_stop_tx(port);
 }
 
 static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
-- 
2.35.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-02-24 11:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 11:10 [PATCH 0/5] tty: serial: various cleanups Jiri Slaby
2022-02-24 11:10 ` [PATCH 1/5] tty: serial: mpc52xx_uart: make rx/tx hooks return unsigned Jiri Slaby
2022-04-03 15:36   ` Guenter Roeck
2022-02-24 11:10 ` [PATCH 2/5] tty: serial: serial_txx9: remove info print from init Jiri Slaby
2022-02-24 11:10 ` [PATCH 3/5] tty: serial: serial_txx9: remove struct uart_txx9_port Jiri Slaby
2022-02-24 11:10 ` [PATCH 4/5] tty: serial: amba-pl010: use more uart_port pointers Jiri Slaby
2022-02-24 11:10 ` Jiri Slaby [this message]
2022-02-24 11:10   ` [PATCH 5/5] tty: serial: lpc32xx_hs: use serial_lpc32xx_stop_tx() helper Jiri Slaby
2022-02-25  9:39 ` [PATCH 0/5] tty: serial: various cleanups Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220224111028.20917-6-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.