diff options
author | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2022-10-19 12:11:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-03 03:35:41 +0100 |
commit | 26e8f1d9a88144b35b35ce3b9df2d437d8cb2ed8 (patch) | |
tree | 127bedd24036c489218b57ac56ad5829857e8c6f /drivers | |
parent | cacf7f689b9b783d1efaf4b545d8038ee6edc73e (diff) | |
download | linux-stable-26e8f1d9a88144b35b35ce3b9df2d437d8cb2ed8.tar.gz linux-stable-26e8f1d9a88144b35b35ce3b9df2d437d8cb2ed8.tar.bz2 linux-stable-26e8f1d9a88144b35b35ce3b9df2d437d8cb2ed8.zip |
serial: imx: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper.
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221019091151.6692-18-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/tty/serial/imx.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c index 05b432dc7a85..a7548d0a1aee 100644 --- a/drivers/tty/serial/imx.c +++ b/drivers/tty/serial/imx.c @@ -563,8 +563,7 @@ static inline void imx_uart_transmit_buffer(struct imx_port *sport) /* send xmit->buf[xmit->tail] * out the port here */ imx_uart_writel(sport, xmit->buf[xmit->tail], URTX0); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - sport->port.icount.tx++; + uart_xmit_advance(&sport->port, 1); } if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) @@ -590,9 +589,7 @@ static void imx_uart_dma_tx_callback(void *data) ucr1 &= ~UCR1_TXDMAEN; imx_uart_writel(sport, ucr1, UCR1); - /* update the stat */ - xmit->tail = (xmit->tail + sport->tx_bytes) & (UART_XMIT_SIZE - 1); - sport->port.icount.tx += sport->tx_bytes; + uart_xmit_advance(&sport->port, sport->tx_bytes); dev_dbg(sport->port.dev, "we finish the TX DMA.\n"); |