Commit d9c12811 authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman

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 <tklauser@distanz.ch>
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220920052049.20507-3-jslaby@suse.czSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 0c0bfc6b
...@@ -272,10 +272,8 @@ static void altera_uart_tx_chars(struct altera_uart *pp) ...@@ -272,10 +272,8 @@ static void altera_uart_tx_chars(struct altera_uart *pp)
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
uart_write_wakeup(port); uart_write_wakeup(port);
if (xmit->head == xmit->tail) { if (uart_circ_empty(xmit))
pp->imr &= ~ALTERA_UART_CONTROL_TRDY_MSK; altera_uart_stop_tx(port);
altera_uart_update_ctrl_reg(pp);
}
} }
static irqreturn_t altera_uart_interrupt(int irq, void *data) static irqreturn_t altera_uart_interrupt(int irq, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment