tty: serial: switch from circ_buf to kfifo
[linux-block.git] / drivers / tty / serial / sunsu.c
index c8b65f4b2710e47f361d578d639d3ef9bd114107..67a5fc70bb4b9053e4beea14a6636b29cf33c1a5 100644 (file)
@@ -396,7 +396,8 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
 
 static void transmit_chars(struct uart_sunsu_port *up)
 {
-       struct circ_buf *xmit = &up->port.state->xmit;
+       struct tty_port *tport = &up->port.state->port;
+       unsigned char ch;
        int count;
 
        if (up->port.x_char) {
@@ -409,23 +410,23 @@ static void transmit_chars(struct uart_sunsu_port *up)
                sunsu_stop_tx(&up->port);
                return;
        }
-       if (uart_circ_empty(xmit)) {
+       if (kfifo_is_empty(&tport->xmit_fifo)) {
                __stop_tx(up);
                return;
        }
 
        count = up->port.fifosize;
        do {
-               serial_out(up, UART_TX, xmit->buf[xmit->tail]);
-               uart_xmit_advance(&up->port, 1);
-               if (uart_circ_empty(xmit))
+               if (!uart_fifo_get(&up->port, &ch))
                        break;
+
+               serial_out(up, UART_TX, ch);
        } while (--count > 0);
 
-       if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
+       if (kfifo_len(&tport->xmit_fifo) < WAKEUP_CHARS)
                uart_write_wakeup(&up->port);
 
-       if (uart_circ_empty(xmit))
+       if (kfifo_is_empty(&tport->xmit_fifo))
                __stop_tx(up);
 }