diff options
Diffstat (limited to 'drivers/char/nozomi.c')
-rw-r--r-- | drivers/char/nozomi.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index a6638003f530..817169cbb245 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c @@ -1611,6 +1611,8 @@ static int ntty_install(struct tty_driver *driver, struct tty_struct *tty) ret = tty_init_termios(tty); if (ret == 0) { tty_driver_kref_get(driver); + tty->count++; + tty->driver_data = port; driver->ttys[tty->index] = tty; } return ret; @@ -1639,7 +1641,7 @@ static int ntty_activate(struct tty_port *tport, struct tty_struct *tty) static int ntty_open(struct tty_struct *tty, struct file *filp) { - struct port *port = get_port_by_tty(tty); + struct port *port = tty->driver_data; return tty_port_open(&port->port, tty, filp); } @@ -1741,8 +1743,7 @@ static int ntty_write_room(struct tty_struct *tty) if (dc) { mutex_lock(&port->tty_sem); if (port->port.count) - room = port->fifo_ul.size - - kfifo_len(&port->fifo_ul); + room = kfifo_avail(&port->fifo_ul); mutex_unlock(&port->tty_sem); } return room; |