aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/ar933x_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/ar933x_uart.c')
-rw-r--r--drivers/tty/serial/ar933x_uart.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c
index 505c490c0b44..27f20c57abed 100644
--- a/drivers/tty/serial/ar933x_uart.c
+++ b/drivers/tty/serial/ar933x_uart.c
@@ -297,10 +297,9 @@ static void ar933x_uart_set_termios(struct uart_port *port,
297 297
298static void ar933x_uart_rx_chars(struct ar933x_uart_port *up) 298static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
299{ 299{
300 struct tty_struct *tty; 300 struct tty_port *port = &up->port.state->port;
301 int max_count = 256; 301 int max_count = 256;
302 302
303 tty = tty_port_tty_get(&up->port.state->port);
304 do { 303 do {
305 unsigned int rdata; 304 unsigned int rdata;
306 unsigned char ch; 305 unsigned char ch;
@@ -313,11 +312,6 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
313 ar933x_uart_write(up, AR933X_UART_DATA_REG, 312 ar933x_uart_write(up, AR933X_UART_DATA_REG,
314 AR933X_UART_DATA_RX_CSR); 313 AR933X_UART_DATA_RX_CSR);
315 314
316 if (!tty) {
317 /* discard the data if no tty available */
318 continue;
319 }
320
321 up->port.icount.rx++; 315 up->port.icount.rx++;
322 ch = rdata & AR933X_UART_DATA_TX_RX_MASK; 316 ch = rdata & AR933X_UART_DATA_TX_RX_MASK;
323 317
@@ -325,13 +319,10 @@ static void ar933x_uart_rx_chars(struct ar933x_uart_port *up)
325 continue; 319 continue;
326 320
327 if ((up->port.ignore_status_mask & AR933X_DUMMY_STATUS_RD) == 0) 321 if ((up->port.ignore_status_mask & AR933X_DUMMY_STATUS_RD) == 0)
328 tty_insert_flip_char(tty, ch, TTY_NORMAL); 322 tty_insert_flip_char(port, ch, TTY_NORMAL);
329 } while (max_count-- > 0); 323 } while (max_count-- > 0);
330 324
331 if (tty) { 325 tty_flip_buffer_push(port);
332 tty_flip_buffer_push(tty);
333 tty_kref_put(tty);
334 }
335} 326}
336 327
337static void ar933x_uart_tx_chars(struct ar933x_uart_port *up) 328static void ar933x_uart_tx_chars(struct ar933x_uart_port *up)