From: Ilpo Järvinen Date: Wed, 19 Oct 2022 09:11:18 +0000 (+0300) Subject: serial: atmel: Use uart_xmit_advance() X-Git-Tag: v6.2-rc1~68^2~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=add147a4591e20732c3f51ed63414d9e89757e5f;p=thirdparty%2Fkernel%2Flinux.git serial: atmel: Use uart_xmit_advance() Take advantage of the new uart_xmit_advance() helper. Reviewed-by: Claudiu Beznea Acked-By: Richard GENOUD Signed-off-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20221019091151.6692-12-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index a6b4d30c5888d..4ca04676c4066 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c @@ -859,10 +859,7 @@ static void atmel_complete_tx_dma(void *arg) if (chan) dmaengine_terminate_all(chan); - xmit->tail += atmel_port->tx_len; - xmit->tail &= UART_XMIT_SIZE - 1; - - port->icount.tx += atmel_port->tx_len; + uart_xmit_advance(port, atmel_port->tx_len); spin_lock_irq(&atmel_port->lock_tx); async_tx_ack(atmel_port->desc_tx); @@ -1455,11 +1452,7 @@ static void atmel_tx_pdc(struct uart_port *port) /* nothing left to transmit? */ if (atmel_uart_readl(port, ATMEL_PDC_TCR)) return; - - xmit->tail += pdc->ofs; - xmit->tail &= UART_XMIT_SIZE - 1; - - port->icount.tx += pdc->ofs; + uart_xmit_advance(port, pdc->ofs); pdc->ofs = 0; /* more to transmit - setup next transfer */