aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/sn_console.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/tty/serial/sn_console.c')
-rw-r--r--drivers/tty/serial/sn_console.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/tty/serial/sn_console.c b/drivers/tty/serial/sn_console.c
index 1c6de9f58699..f51ffdc696fd 100644
--- a/drivers/tty/serial/sn_console.c
+++ b/drivers/tty/serial/sn_console.c
@@ -457,8 +457,8 @@ static int sn_debug_printf(const char *fmt, ...)
457static void 457static void
458sn_receive_chars(struct sn_cons_port *port, unsigned long flags) 458sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
459{ 459{
460 struct tty_port *tport = NULL;
460 int ch; 461 int ch;
461 struct tty_struct *tty;
462 462
463 if (!port) { 463 if (!port) {
464 printk(KERN_ERR "sn_receive_chars - port NULL so can't receive\n"); 464 printk(KERN_ERR "sn_receive_chars - port NULL so can't receive\n");
@@ -472,11 +472,7 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
472 472
473 if (port->sc_port.state) { 473 if (port->sc_port.state) {
474 /* The serial_core stuffs are initialized, use them */ 474 /* The serial_core stuffs are initialized, use them */
475 tty = port->sc_port.state->port.tty; 475 tport = &port->sc_port.state->port;
476 }
477 else {
478 /* Not registered yet - can't pass to tty layer. */
479 tty = NULL;
480 } 476 }
481 477
482 while (port->sc_ops->sal_input_pending()) { 478 while (port->sc_ops->sal_input_pending()) {
@@ -516,15 +512,15 @@ sn_receive_chars(struct sn_cons_port *port, unsigned long flags)
516#endif /* CONFIG_MAGIC_SYSRQ */ 512#endif /* CONFIG_MAGIC_SYSRQ */
517 513
518 /* record the character to pass up to the tty layer */ 514 /* record the character to pass up to the tty layer */
519 if (tty) { 515 if (tport) {
520 if(tty_insert_flip_char(tty, ch, TTY_NORMAL) == 0) 516 if (tty_insert_flip_char(tport, ch, TTY_NORMAL) == 0)
521 break; 517 break;
522 } 518 }
523 port->sc_port.icount.rx++; 519 port->sc_port.icount.rx++;
524 } 520 }
525 521
526 if (tty) 522 if (tport)
527 tty_flip_buffer_push(tty); 523 tty_flip_buffer_push(tport);
528} 524}
529 525
530/** 526/**