diff options
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r-- | drivers/tty/nozomi.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c index 437a6366fb7b..941fe8060ea5 100644 --- a/drivers/tty/nozomi.c +++ b/drivers/tty/nozomi.c | |||
@@ -827,15 +827,10 @@ static int receive_data(enum port_type index, struct nozomi *dc) | |||
827 | struct tty_struct *tty = tty_port_tty_get(&port->port); | 827 | struct tty_struct *tty = tty_port_tty_get(&port->port); |
828 | int i, ret; | 828 | int i, ret; |
829 | 829 | ||
830 | if (unlikely(!tty)) { | ||
831 | DBG1("tty not open for port: %d?", index); | ||
832 | return 1; | ||
833 | } | ||
834 | |||
835 | read_mem32((u32 *) &size, addr, 4); | 830 | read_mem32((u32 *) &size, addr, 4); |
836 | /* DBG1( "%d bytes port: %d", size, index); */ | 831 | /* DBG1( "%d bytes port: %d", size, index); */ |
837 | 832 | ||
838 | if (test_bit(TTY_THROTTLED, &tty->flags)) { | 833 | if (tty && test_bit(TTY_THROTTLED, &tty->flags)) { |
839 | DBG1("No room in tty, don't read data, don't ack interrupt, " | 834 | DBG1("No room in tty, don't read data, don't ack interrupt, " |
840 | "disable interrupt"); | 835 | "disable interrupt"); |
841 | 836 | ||
@@ -858,10 +853,11 @@ static int receive_data(enum port_type index, struct nozomi *dc) | |||
858 | tty_insert_flip_char(&port->port, buf[0], TTY_NORMAL); | 853 | tty_insert_flip_char(&port->port, buf[0], TTY_NORMAL); |
859 | size = 0; | 854 | size = 0; |
860 | } else if (size < RECEIVE_BUF_MAX) { | 855 | } else if (size < RECEIVE_BUF_MAX) { |
861 | size -= tty_insert_flip_string(tty, (char *) buf, size); | 856 | size -= tty_insert_flip_string(&port->port, |
857 | (char *)buf, size); | ||
862 | } else { | 858 | } else { |
863 | i = tty_insert_flip_string(tty, \ | 859 | i = tty_insert_flip_string(&port->port, |
864 | (char *) buf, RECEIVE_BUF_MAX); | 860 | (char *)buf, RECEIVE_BUF_MAX); |
865 | size -= i; | 861 | size -= i; |
866 | offset += i; | 862 | offset += i; |
867 | } | 863 | } |