serial: samsung_tty: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper. Reviewed-by: Sam Protsenko <semen.protsenko@linaro.org> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20221019091151.6692-29-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
3d4d838423
commit
ec04d75fe4
@ -288,7 +288,6 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
|
||||
{
|
||||
struct s3c24xx_uart_port *ourport = to_ourport(port);
|
||||
struct s3c24xx_uart_dma *dma = ourport->dma;
|
||||
struct circ_buf *xmit = &port->state->xmit;
|
||||
struct dma_tx_state state;
|
||||
int count;
|
||||
|
||||
@ -316,8 +315,7 @@ static void s3c24xx_serial_stop_tx(struct uart_port *port)
|
||||
DMA_TO_DEVICE);
|
||||
async_tx_ack(dma->tx_desc);
|
||||
count = dma->tx_bytes_requested - state.residue;
|
||||
xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
|
||||
port->icount.tx += count;
|
||||
uart_xmit_advance(port, count);
|
||||
}
|
||||
|
||||
ourport->tx_enabled = 0;
|
||||
@ -351,8 +349,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args)
|
||||
|
||||
spin_lock_irqsave(&port->lock, flags);
|
||||
|
||||
xmit->tail = (xmit->tail + count) & (UART_XMIT_SIZE - 1);
|
||||
port->icount.tx += count;
|
||||
uart_xmit_advance(port, count);
|
||||
ourport->tx_in_progress = 0;
|
||||
|
||||
if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
|
||||
@ -916,8 +913,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport)
|
||||
break;
|
||||
|
||||
wr_reg(port, S3C2410_UTXH, xmit->buf[xmit->tail]);
|
||||
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
|
||||
port->icount.tx++;
|
||||
uart_xmit_advance(port, 1);
|
||||
count--;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user