Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: core: introduce uart_port_tx_limited_flags()

Analogue to uart_port_tx_flags() introduced in commit 3ee07964d407
("serial: core: introduce uart_port_tx_flags()"), add a _flags variant
for uart_port_tx_limited().

Fixes: d11cc8c3c4b6 ("tty: serial: use uart_port_tx_limited()")
Cc: stable@vger.kernel.org
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Signed-off-by: Doug Brown <doug@schmorgal.com>
Link: https://lore.kernel.org/r/20240606195632.173255-3-doug@schmorgal.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jonas Gorski and committed by
Greg Kroah-Hartman
9bb43b9e c5603e2a

+18
+18
include/linux/serial_core.h
··· 851 851 }) 852 852 853 853 /** 854 + * uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags 855 + * @port: uart port 856 + * @ch: variable to store a character to be written to the HW 857 + * @flags: %UART_TX_NOSTOP or similar 858 + * @count: a limit of characters to send 859 + * @tx_ready: can HW accept more data function 860 + * @put_char: function to write a character 861 + * @tx_done: function to call after the loop is done 862 + * 863 + * See uart_port_tx_limited() for more details. 864 + */ 865 + #define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \ 866 + unsigned int __count = (count); \ 867 + __uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \ 868 + __count--); \ 869 + }) 870 + 871 + /** 854 872 * uart_port_tx -- transmit helper for uart_port 855 873 * @port: uart port 856 874 * @ch: variable to store a character to be written to the HW