diff options
-rw-r--r-- | drivers/tty/n_tty.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 0d3f715de7d2..d655416087b7 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -204,9 +204,8 @@ static void put_tty_queue(unsigned char c, struct n_tty_data *ldata) | |||
204 | * Locking: tty_read_lock for read fields. | 204 | * Locking: tty_read_lock for read fields. |
205 | */ | 205 | */ |
206 | 206 | ||
207 | static void reset_buffer_flags(struct tty_struct *tty) | 207 | static void reset_buffer_flags(struct n_tty_data *ldata) |
208 | { | 208 | { |
209 | struct n_tty_data *ldata = tty->disc_data; | ||
210 | unsigned long flags; | 209 | unsigned long flags; |
211 | 210 | ||
212 | raw_spin_lock_irqsave(&ldata->read_lock, flags); | 211 | raw_spin_lock_irqsave(&ldata->read_lock, flags); |
@@ -219,7 +218,6 @@ static void reset_buffer_flags(struct tty_struct *tty) | |||
219 | 218 | ||
220 | ldata->canon_head = ldata->canon_data = ldata->erasing = 0; | 219 | ldata->canon_head = ldata->canon_data = ldata->erasing = 0; |
221 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); | 220 | bitmap_zero(ldata->read_flags, N_TTY_BUF_SIZE); |
222 | n_tty_set_room(tty); | ||
223 | } | 221 | } |
224 | 222 | ||
225 | static void n_tty_packet_mode_flush(struct tty_struct *tty) | 223 | static void n_tty_packet_mode_flush(struct tty_struct *tty) |
@@ -247,7 +245,8 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty) | |||
247 | 245 | ||
248 | static void n_tty_flush_buffer(struct tty_struct *tty) | 246 | static void n_tty_flush_buffer(struct tty_struct *tty) |
249 | { | 247 | { |
250 | reset_buffer_flags(tty); | 248 | reset_buffer_flags(tty->disc_data); |
249 | n_tty_set_room(tty); | ||
251 | 250 | ||
252 | if (tty->link) | 251 | if (tty->link) |
253 | n_tty_packet_mode_flush(tty); | 252 | n_tty_packet_mode_flush(tty); |
@@ -1633,14 +1632,14 @@ static int n_tty_open(struct tty_struct *tty) | |||
1633 | goto err_free_bufs; | 1632 | goto err_free_bufs; |
1634 | 1633 | ||
1635 | tty->disc_data = ldata; | 1634 | tty->disc_data = ldata; |
1636 | /* indicate buffer work may resume */ | 1635 | reset_buffer_flags(tty->disc_data); |
1637 | clear_bit(TTY_LDISC_HALTED, &tty->flags); | ||
1638 | reset_buffer_flags(tty); | ||
1639 | tty_unthrottle(tty); | ||
1640 | ldata->column = 0; | 1636 | ldata->column = 0; |
1641 | n_tty_set_termios(tty, NULL); | ||
1642 | tty->minimum_to_wake = 1; | 1637 | tty->minimum_to_wake = 1; |
1643 | tty->closing = 0; | 1638 | tty->closing = 0; |
1639 | /* indicate buffer work may resume */ | ||
1640 | clear_bit(TTY_LDISC_HALTED, &tty->flags); | ||
1641 | n_tty_set_termios(tty, NULL); | ||
1642 | tty_unthrottle(tty); | ||
1644 | 1643 | ||
1645 | return 0; | 1644 | return 0; |
1646 | err_free_bufs: | 1645 | err_free_bufs: |