]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
serial: atmel: Use uart_xmit_advance()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Wed, 19 Oct 2022 09:11:18 +0000 (12:11 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 02:35:41 +0000 (03:35 +0100)
Take advantage of the new uart_xmit_advance() helper.

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Acked-By: Richard GENOUD <richard.genoud@gmail.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20221019091151.6692-12-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c

index a6b4d30c5888d8e9f485af2483d2a75016f25e83..4ca04676c40660846d54407c4557d22f42dcba8a 100644 (file)
@@ -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 */