]> Git Repo - J-linux.git/blobdiff - drivers/tty/serial/sccnxp.c
Merge tag 'vfs-6.13-rc7.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
[J-linux.git] / drivers / tty / serial / sccnxp.c
index f24217a560d7a21a8d9c1048717129494a90bf38..4c851dae6624f87afb4d86d62e3ec2d38c4c8ee7 100644 (file)
@@ -439,7 +439,7 @@ static void sccnxp_handle_rx(struct uart_port *port)
 static void sccnxp_handle_tx(struct uart_port *port)
 {
        u8 sr;
-       struct circ_buf *xmit = &port->state->xmit;
+       struct tty_port *tport = &port->state->port;
        struct sccnxp_port *s = dev_get_drvdata(port->dev);
 
        if (unlikely(port->x_char)) {
@@ -449,7 +449,7 @@ static void sccnxp_handle_tx(struct uart_port *port)
                return;
        }
 
-       if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
+       if (kfifo_is_empty(&tport->xmit_fifo) || uart_tx_stopped(port)) {
                /* Disable TX if FIFO is empty */
                if (sccnxp_port_read(port, SCCNXP_SR_REG) & SR_TXEMT) {
                        sccnxp_disable_irq(port, IMR_TXRDY);
@@ -461,16 +461,20 @@ static void sccnxp_handle_tx(struct uart_port *port)
                return;
        }
 
-       while (!uart_circ_empty(xmit)) {
+       while (1) {
+               unsigned char ch;
+
                sr = sccnxp_port_read(port, SCCNXP_SR_REG);
                if (!(sr & SR_TXRDY))
                        break;
 
-               sccnxp_port_write(port, SCCNXP_THR_REG, xmit->buf[xmit->tail]);
-               uart_xmit_advance(port, 1);
+               if (!uart_fifo_get(port, &ch))
+                       break;
+
+               sccnxp_port_write(port, SCCNXP_THR_REG, ch);
        }
 
-       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+       if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
                uart_write_wakeup(port);
 }
 
@@ -1048,7 +1052,7 @@ static struct platform_driver sccnxp_uart_driver = {
                .name   = SCCNXP_NAME,
        },
        .probe          = sccnxp_probe,
-       .remove_new     = sccnxp_remove,
+       .remove         = sccnxp_remove,
        .id_table       = sccnxp_id_table,
 };
 module_platform_driver(sccnxp_uart_driver);
This page took 0.03746 seconds and 4 git commands to generate.