]> Git Repo - linux.git/blobdiff - drivers/tty/serial/sccnxp.c
x86/kaslr: Expose and use the end of the physical memory address space
[linux.git] / drivers / tty / serial / sccnxp.c
index f24217a560d7a21a8d9c1048717129494a90bf38..6d1d142fd2161f4ab79a51be9125907f76461858 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);
 }
 
This page took 0.0348 seconds and 4 git commands to generate.