aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sunsu.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sunsu.c')
-rw-r--r--drivers/tty/serial/sunsu.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 220da3f9724f..e343d6670854 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -315,10 +315,10 @@ static void sunsu_enable_ms(struct uart_port *port)
315 spin_unlock_irqrestore(&up->port.lock, flags); 315 spin_unlock_irqrestore(&up->port.lock, flags);
316} 316}
317 317
318static struct tty_struct * 318static void
319receive_chars(struct uart_sunsu_port *up, unsigned char *status) 319receive_chars(struct uart_sunsu_port *up, unsigned char *status)
320{ 320{
321 struct tty_struct *tty = up->port.state->port.tty; 321 struct tty_port *port = &up->port.state->port;
322 unsigned char ch, flag; 322 unsigned char ch, flag;
323 int max_count = 256; 323 int max_count = 256;
324 int saw_console_brk = 0; 324 int saw_console_brk = 0;
@@ -376,22 +376,20 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status)
376 if (uart_handle_sysrq_char(&up->port, ch)) 376 if (uart_handle_sysrq_char(&up->port, ch))
377 goto ignore_char; 377 goto ignore_char;
378 if ((*status & up->port.ignore_status_mask) == 0) 378 if ((*status & up->port.ignore_status_mask) == 0)
379 tty_insert_flip_char(tty, ch, flag); 379 tty_insert_flip_char(port, ch, flag);
380 if (*status & UART_LSR_OE) 380 if (*status & UART_LSR_OE)
381 /* 381 /*
382 * Overrun is special, since it's reported 382 * Overrun is special, since it's reported
383 * immediately, and doesn't affect the current 383 * immediately, and doesn't affect the current
384 * character. 384 * character.
385 */ 385 */
386 tty_insert_flip_char(tty, 0, TTY_OVERRUN); 386 tty_insert_flip_char(port, 0, TTY_OVERRUN);
387 ignore_char: 387 ignore_char:
388 *status = serial_inp(up, UART_LSR); 388 *status = serial_inp(up, UART_LSR);
389 } while ((*status & UART_LSR_DR) && (max_count-- > 0)); 389 } while ((*status & UART_LSR_DR) && (max_count-- > 0));
390 390
391 if (saw_console_brk) 391 if (saw_console_brk)
392 sun_do_break(); 392 sun_do_break();
393
394 return tty;
395} 393}
396 394
397static void transmit_chars(struct uart_sunsu_port *up) 395static void transmit_chars(struct uart_sunsu_port *up)
@@ -460,20 +458,16 @@ static irqreturn_t sunsu_serial_interrupt(int irq, void *dev_id)
460 spin_lock_irqsave(&up->port.lock, flags); 458 spin_lock_irqsave(&up->port.lock, flags);
461 459
462 do { 460 do {
463 struct tty_struct *tty;
464
465 status = serial_inp(up, UART_LSR); 461 status = serial_inp(up, UART_LSR);
466 tty = NULL;
467 if (status & UART_LSR_DR) 462 if (status & UART_LSR_DR)
468 tty = receive_chars(up, &status); 463 receive_chars(up, &status);
469 check_modem_status(up); 464 check_modem_status(up);
470 if (status & UART_LSR_THRE) 465 if (status & UART_LSR_THRE)
471 transmit_chars(up); 466 transmit_chars(up);
472 467
473 spin_unlock_irqrestore(&up->port.lock, flags); 468 spin_unlock_irqrestore(&up->port.lock, flags);
474 469
475 if (tty) 470 tty_flip_buffer_push(&up->port.state->port);
476 tty_flip_buffer_push(tty);
477 471
478 spin_lock_irqsave(&up->port.lock, flags); 472 spin_lock_irqsave(&up->port.lock, flags);
479 473