Skip to content

Commit 195437d

Browse files
VCASTMgregkh
authored andcommitted
serial: stm32: correct loop for dma error handling
In this error handling, "transmit_chars_dma" function will call "transmit_chars_pio" once per characters. But "transmit_chars_pio" will continue to send characters while xmit buffer is not empty. Remove this useless loop, one call is sufficient. Signed-off-by: Valentin Caron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2a3bcfe commit 195437d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/tty/serial/stm32-usart.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port)
477477
const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
478478
struct circ_buf *xmit = &port->state->xmit;
479479
struct dma_async_tx_descriptor *desc = NULL;
480-
unsigned int count, i;
480+
unsigned int count;
481481

482482
if (stm32_usart_tx_dma_started(stm32port)) {
483483
if (!stm32_usart_tx_dma_enabled(stm32port))
@@ -542,8 +542,7 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port)
542542
return;
543543

544544
fallback_err:
545-
for (i = count; i > 0; i--)
546-
stm32_usart_transmit_chars_pio(port);
545+
stm32_usart_transmit_chars_pio(port);
547546
}
548547

549548
static void stm32_usart_transmit_chars(struct uart_port *port)

0 commit comments

Comments
 (0)