mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-09 23:34:42 +08:00
serial: core: introduce uart_port_tx_limited_flags()
commit9bb43b9e8d
upstream. Analogue to uart_port_tx_flags() introduced in commit3ee07964d4
("serial: core: introduce uart_port_tx_flags()"), add a _flags variant for uart_port_tx_limited(). Fixes:d11cc8c3c4
("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>
This commit is contained in:
parent
d75b8ae150
commit
60dc1a2a3f
@ -826,6 +826,24 @@ enum UART_TX_FLAGS {
|
|||||||
__count--); \
|
__count--); \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uart_port_tx_limited_flags -- transmit helper for uart_port with count limiting with flags
|
||||||
|
* @port: uart port
|
||||||
|
* @ch: variable to store a character to be written to the HW
|
||||||
|
* @flags: %UART_TX_NOSTOP or similar
|
||||||
|
* @count: a limit of characters to send
|
||||||
|
* @tx_ready: can HW accept more data function
|
||||||
|
* @put_char: function to write a character
|
||||||
|
* @tx_done: function to call after the loop is done
|
||||||
|
*
|
||||||
|
* See uart_port_tx_limited() for more details.
|
||||||
|
*/
|
||||||
|
#define uart_port_tx_limited_flags(port, ch, flags, count, tx_ready, put_char, tx_done) ({ \
|
||||||
|
unsigned int __count = (count); \
|
||||||
|
__uart_port_tx(port, ch, flags, tx_ready, put_char, tx_done, __count, \
|
||||||
|
__count--); \
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uart_port_tx -- transmit helper for uart_port
|
* uart_port_tx -- transmit helper for uart_port
|
||||||
* @port: uart port
|
* @port: uart port
|
||||||
|
Loading…
Reference in New Issue
Block a user