aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <[email protected]>2022-09-20 07:20:42 +0200
committerGreg Kroah-Hartman <[email protected]>2022-09-22 16:14:07 +0200
commitd9c128117da41cf4cb0e80ae565b5d3ac79dffac (patch)
treeaad6c3ed5eb55d8b42bf5e1f0fb6c4c75dd432ec
parent0c0bfc6b14388356ce6016b9d548ac8b874013e0 (diff)
tty: serial: clean up stop-tx part in altera_uart_tx_chars()
The "stop TX" path in altera_uart_tx_chars() is open-coded, so: * use uart_circ_empty() to check if the buffer is empty, and * when true, call altera_uart_stop_tx(). Cc: Tobias Klauser <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Acked-by: Tobias Klauser <[email protected]> Signed-off-by: Jiri Slaby <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r--drivers/tty/serial/altera_uart.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/tty/serial/altera_uart.c b/drivers/tty/serial/altera_uart.c
index a38db2cb8dc1..4170e66601ec 100644
--- a/drivers/tty/serial/altera_uart.c
+++ b/drivers/tty/serial/altera_uart.c
@@ -272,10 +272,8 @@ static void altera_uart_tx_chars(struct altera_uart *pp)
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port);
- if (xmit->head == xmit->tail) {
- pp->imr &= ~ALTERA_UART_CONTROL_TRDY_MSK;
- altera_uart_update_ctrl_reg(pp);
- }
+ if (uart_circ_empty(xmit))
+ altera_uart_stop_tx(port);
}
static irqreturn_t altera_uart_interrupt(int irq, void *data)