summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/fsl_lpuart.c
diff options
context:
space:
mode:
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2022-10-19 12:11:23 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-11-03 03:35:41 +0100
commitcacf7f689b9b783d1efaf4b545d8038ee6edc73e (patch)
tree93a74ce706f3fb033fe94f4373b5401b8f3cf7bb /drivers/tty/serial/fsl_lpuart.c
parent7840a92a3e7d7f78bdc16b75c62101bc240bfa93 (diff)
serial: fsl_lpuart: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper. Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20221019091151.6692-17-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/fsl_lpuart.c')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index d811eda1844e..849ef313b824 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -535,9 +535,7 @@ static void lpuart_dma_tx_complete(void *arg)
dma_unmap_sg(chan->device->dev, sgl, sport->dma_tx_nents,
DMA_TO_DEVICE);
- xmit->tail = (xmit->tail + sport->dma_tx_bytes) & (UART_XMIT_SIZE - 1);
-
- sport->port.icount.tx += sport->dma_tx_bytes;
+ uart_xmit_advance(&sport->port, sport->dma_tx_bytes);
sport->dma_tx_in_progress = false;
spin_unlock_irqrestore(&sport->port.lock, flags);
@@ -772,8 +770,7 @@ static inline void lpuart32_transmit_buffer(struct lpuart_port *sport)
txcnt &= UARTWATER_COUNT_MASK;
while (!uart_circ_empty(xmit) && (txcnt < sport->txfifo_size)) {
lpuart32_write(&sport->port, xmit->buf[xmit->tail], UARTDATA);
- xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
- sport->port.icount.tx++;
+ uart_xmit_advance(&sport->port, 1);
txcnt = lpuart32_read(&sport->port, UARTWATER);
txcnt = txcnt >> UARTWATER_TXCNT_OFF;
txcnt &= UARTWATER_COUNT_MASK;