]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty: serial: clean up stop-tx part in altera_uart_tx_chars()
authorJiri Slaby <jslaby@suse.cz>
Tue, 20 Sep 2022 05:20:42 +0000 (07:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:25 +0000 (13:26 +0100)
commitcec01323817b11327937e5600245462573f60e4e
tree42ebf3960fcee3b618dae8c73228b4440bbf8ef1
parent4f5d28865c665c9064de631a518f9bc8099d9ce4
tty: serial: clean up stop-tx part in altera_uart_tx_chars()

[ Upstream commit d9c128117da41cf4cb0e80ae565b5d3ac79dffac ]

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: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Acked-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20220920052049.20507-3-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 1307c5d33cce ("serial: altera_uart: fix locking in polling mode")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/tty/serial/altera_uart.c