aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/amba-pl011.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/amba-pl011.c')
-rw-r--r--drivers/tty/serial/amba-pl011.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 7fca4022a8b2..3ea5408fcbeb 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -698,7 +698,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
698 u32 pending, bool use_buf_b, 698 u32 pending, bool use_buf_b,
699 bool readfifo) 699 bool readfifo)
700{ 700{
701 struct tty_struct *tty = uap->port.state->port.tty; 701 struct tty_port *port = &uap->port.state->port;
702 struct pl011_sgbuf *sgbuf = use_buf_b ? 702 struct pl011_sgbuf *sgbuf = use_buf_b ?
703 &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a; 703 &uap->dmarx.sgbuf_b : &uap->dmarx.sgbuf_a;
704 struct device *dev = uap->dmarx.chan->device->dev; 704 struct device *dev = uap->dmarx.chan->device->dev;
@@ -715,8 +715,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
715 * Note that tty_insert_flip_buf() tries to take as many chars 715 * Note that tty_insert_flip_buf() tries to take as many chars
716 * as it can. 716 * as it can.
717 */ 717 */
718 dma_count = tty_insert_flip_string(uap->port.state->port.tty, 718 dma_count = tty_insert_flip_string(port, sgbuf->buf, pending);
719 sgbuf->buf, pending);
720 719
721 /* Return buffer to device */ 720 /* Return buffer to device */
722 dma_sync_sg_for_device(dev, &sgbuf->sg, 1, DMA_FROM_DEVICE); 721 dma_sync_sg_for_device(dev, &sgbuf->sg, 1, DMA_FROM_DEVICE);
@@ -754,7 +753,7 @@ static void pl011_dma_rx_chars(struct uart_amba_port *uap,
754 dev_vdbg(uap->port.dev, 753 dev_vdbg(uap->port.dev,
755 "Took %d chars from DMA buffer and %d chars from the FIFO\n", 754 "Took %d chars from DMA buffer and %d chars from the FIFO\n",
756 dma_count, fifotaken); 755 dma_count, fifotaken);
757 tty_flip_buffer_push(tty); 756 tty_flip_buffer_push(port);
758 spin_lock(&uap->port.lock); 757 spin_lock(&uap->port.lock);
759} 758}
760 759
@@ -1076,12 +1075,10 @@ static void pl011_enable_ms(struct uart_port *port)
1076 1075
1077static void pl011_rx_chars(struct uart_amba_port *uap) 1076static void pl011_rx_chars(struct uart_amba_port *uap)
1078{ 1077{
1079 struct tty_struct *tty = uap->port.state->port.tty;
1080
1081 pl011_fifo_to_tty(uap); 1078 pl011_fifo_to_tty(uap);
1082 1079
1083 spin_unlock(&uap->port.lock); 1080 spin_unlock(&uap->port.lock);
1084 tty_flip_buffer_push(tty); 1081 tty_flip_buffer_push(&uap->port.state->port);
1085 /* 1082 /*
1086 * If we were temporarily out of DMA mode for a while, 1083 * If we were temporarily out of DMA mode for a while,
1087 * attempt to switch back to DMA mode again. 1084 * attempt to switch back to DMA mode again.