Commit 195437d1 authored by Valentin Caron's avatar Valentin Caron Committed by Greg Kroah-Hartman
Browse files

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: default avatarValentin Caron <valentin.caron@foss.st.com>
Link: https://lore.kernel.org/r/20220104182445.4195-5-valentin.caron@foss.st.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2a3bcfe0
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -477,7 +477,7 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port)
	const struct stm32_usart_offsets *ofs = &stm32port->info->ofs;
	struct circ_buf *xmit = &port->state->xmit;
	struct dma_async_tx_descriptor *desc = NULL;
	unsigned int count, i;
	unsigned int count;

	if (stm32_usart_tx_dma_started(stm32port)) {
		if (!stm32_usart_tx_dma_enabled(stm32port))
@@ -542,7 +542,6 @@ static void stm32_usart_transmit_chars_dma(struct uart_port *port)
	return;

fallback_err:
	for (i = count; i > 0; i--)
	stm32_usart_transmit_chars_pio(port);
}