[21/44] serial: max310x: Use uart_xmit_advance()

Message ID 20221019091151.6692-22-ilpo.jarvinen@linux.intel.com
State New
Headers
Series serial: Convert drivers to use uart_xmit_advance() |

Commit Message

Ilpo Järvinen Oct. 19, 2022, 9:11 a.m. UTC
  Take advantage of the new uart_xmit_advance() helper.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
 drivers/tty/serial/max310x.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
  

Comments

Andy Shevchenko Oct. 19, 2022, 11:10 a.m. UTC | #1
On Wed, Oct 19, 2022 at 12:11:28PM +0300, Ilpo Järvinen wrote:
> 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>
> ---
>  drivers/tty/serial/max310x.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index fbf6e2b3161c..4eb24e3407f8 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -787,10 +787,7 @@ static void max310x_handle_tx(struct uart_port *port)
>  		} else {
>  			max310x_batch_write(port, xmit->buf + xmit->tail, to_send);
>  		}
> -
> -		/* Add data to send */
> -		port->icount.tx += to_send;
> -		xmit->tail = (xmit->tail + to_send) & (UART_XMIT_SIZE - 1);
> +		uart_xmit_advance(port, to_send);
>  	}
>  
>  	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
> -- 
> 2.30.2
>
  

Patch

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index fbf6e2b3161c..4eb24e3407f8 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -787,10 +787,7 @@  static void max310x_handle_tx(struct uart_port *port)
 		} else {
 			max310x_batch_write(port, xmit->buf + xmit->tail, to_send);
 		}
-
-		/* Add data to send */
-		port->icount.tx += to_send;
-		xmit->tail = (xmit->tail + to_send) & (UART_XMIT_SIZE - 1);
+		uart_xmit_advance(port, to_send);
 	}
 
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)