Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 9bb43b9

Browse files
KanjiMonstergregkh
authored andcommitted
serial: core: introduce uart_port_tx_limited_flags()
Analogue to uart_port_tx_flags() introduced in commit 3ee0796 ("serial: core: introduce uart_port_tx_flags()"), add a _flags variant for uart_port_tx_limited(). Fixes: d11cc8c ("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>
1 parent c5603e2 commit 9bb43b9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

include/linux/serial_core.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,24 @@ enum UART_TX_FLAGS {
850850
__count--); \
851851
})
852852

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+
853871
/**
854872
* uart_port_tx -- transmit helper for uart_port
855873
* @port: uart port

0 commit comments

Comments
 (0)