mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-05 16:37:50 +00:00
serial: pch_uart: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20221019091151.6692-5-ilpo.jarvinen@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1fcff75f39
commit
a5c9611ddc
1 changed files with 4 additions and 8 deletions
|
@ -738,15 +738,12 @@ static void pch_dma_tx_complete(void *arg)
|
||||||
{
|
{
|
||||||
struct eg20t_port *priv = arg;
|
struct eg20t_port *priv = arg;
|
||||||
struct uart_port *port = &priv->port;
|
struct uart_port *port = &priv->port;
|
||||||
struct circ_buf *xmit = &port->state->xmit;
|
|
||||||
struct scatterlist *sg = priv->sg_tx_p;
|
struct scatterlist *sg = priv->sg_tx_p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < priv->nent; i++, sg++) {
|
for (i = 0; i < priv->nent; i++, sg++)
|
||||||
xmit->tail += sg_dma_len(sg);
|
uart_xmit_advance(port, sg_dma_len(sg));
|
||||||
port->icount.tx += sg_dma_len(sg);
|
|
||||||
}
|
|
||||||
xmit->tail &= UART_XMIT_SIZE - 1;
|
|
||||||
async_tx_ack(priv->desc_tx);
|
async_tx_ack(priv->desc_tx);
|
||||||
dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE);
|
dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE);
|
||||||
priv->tx_dma_use = 0;
|
priv->tx_dma_use = 0;
|
||||||
|
@ -843,8 +840,7 @@ static unsigned int handle_tx(struct eg20t_port *priv)
|
||||||
|
|
||||||
while (!uart_tx_stopped(port) && !uart_circ_empty(xmit) && fifo_size) {
|
while (!uart_tx_stopped(port) && !uart_circ_empty(xmit) && fifo_size) {
|
||||||
iowrite8(xmit->buf[xmit->tail], priv->membase + PCH_UART_THR);
|
iowrite8(xmit->buf[xmit->tail], priv->membase + PCH_UART_THR);
|
||||||
xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
|
uart_xmit_advance(port, 1);
|
||||||
port->icount.tx++;
|
|
||||||
fifo_size--;
|
fifo_size--;
|
||||||
tx_empty = 0;
|
tx_empty = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue