aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-01-03 09:53:07 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-16 01:43:15 -0500
commit6732c8bb8671acbdac6cdc93dd72ddd581dd5e25 (patch)
tree6c70977ee03cddd4211b8f775c331b41532ed5da
parent2e124b4a390ca85325fae75764bef92f0547fa25 (diff)
TTY: switch tty_schedule_flip
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. This is the last one: tty_schedule_flip Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--arch/alpha/kernel/srmcons.c17
-rw-r--r--drivers/s390/char/keyboard.h12
-rw-r--r--drivers/staging/serqt_usb2/serqt_usb2.c19
-rw-r--r--drivers/tty/cyclades.c33
-rw-r--r--drivers/tty/moxa.c4
-rw-r--r--drivers/tty/serial/68328serial.c15
-rw-r--r--drivers/tty/serial/lpc32xx_hs.c6
-rw-r--r--drivers/tty/tty_buffer.c8
-rw-r--r--drivers/tty/vt/keyboard.c19
-rw-r--r--drivers/tty/vt/vt.c16
-rw-r--r--include/linux/tty_flip.h2
11 files changed, 51 insertions, 100 deletions
diff --git a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c
index 21b57a66e809..6f01d9ad7b81 100644
--- a/arch/alpha/kernel/srmcons.c
+++ b/arch/alpha/kernel/srmcons.c
@@ -44,9 +44,8 @@ typedef union _srmcons_result {
44 44
45/* called with callback_lock held */ 45/* called with callback_lock held */
46static int 46static int
47srmcons_do_receive_chars(struct tty_struct *tty) 47srmcons_do_receive_chars(struct tty_port *port)
48{ 48{
49 struct tty_port *port = tty->port;
50 srmcons_result result; 49 srmcons_result result;
51 int count = 0, loops = 0; 50 int count = 0, loops = 0;
52 51
@@ -59,7 +58,7 @@ srmcons_do_receive_chars(struct tty_struct *tty)
59 } while((result.bits.status & 1) && (++loops < 10)); 58 } while((result.bits.status & 1) && (++loops < 10));
60 59
61 if (count) 60 if (count)
62 tty_schedule_flip(tty); 61 tty_schedule_flip(port);
63 62
64 return count; 63 return count;
65} 64}
@@ -74,7 +73,7 @@ srmcons_receive_chars(unsigned long data)
74 73
75 local_irq_save(flags); 74 local_irq_save(flags);
76 if (spin_trylock(&srmcons_callback_lock)) { 75 if (spin_trylock(&srmcons_callback_lock)) {
77 if (!srmcons_do_receive_chars(port->tty)) 76 if (!srmcons_do_receive_chars(port))
78 incr = 100; 77 incr = 100;
79 spin_unlock(&srmcons_callback_lock); 78 spin_unlock(&srmcons_callback_lock);
80 } 79 }
@@ -89,7 +88,7 @@ srmcons_receive_chars(unsigned long data)
89 88
90/* called with callback_lock held */ 89/* called with callback_lock held */
91static int 90static int
92srmcons_do_write(struct tty_struct *tty, const char *buf, int count) 91srmcons_do_write(struct tty_port *port, const char *buf, int count)
93{ 92{
94 static char str_cr[1] = "\r"; 93 static char str_cr[1] = "\r";
95 long c, remaining = count; 94 long c, remaining = count;
@@ -114,10 +113,10 @@ srmcons_do_write(struct tty_struct *tty, const char *buf, int count)
114 cur += result.bits.c; 113 cur += result.bits.c;
115 114
116 /* 115 /*
117 * Check for pending input iff a tty was provided 116 * Check for pending input iff a tty port was provided
118 */ 117 */
119 if (tty) 118 if (port)
120 srmcons_do_receive_chars(tty); 119 srmcons_do_receive_chars(port);
121 } 120 }
122 121
123 while (need_cr) { 122 while (need_cr) {
@@ -136,7 +135,7 @@ srmcons_write(struct tty_struct *tty,
136 unsigned long flags; 135 unsigned long flags;
137 136
138 spin_lock_irqsave(&srmcons_callback_lock, flags); 137 spin_lock_irqsave(&srmcons_callback_lock, flags);
139 srmcons_do_write(tty, (const char *) buf, count); 138 srmcons_do_write(tty->port, (const char *) buf, count);
140 spin_unlock_irqrestore(&srmcons_callback_lock, flags); 139 spin_unlock_irqrestore(&srmcons_callback_lock, flags);
141 140
142 return count; 141 return count;
diff --git a/drivers/s390/char/keyboard.h b/drivers/s390/char/keyboard.h
index acab28d4f06b..a31f339211d5 100644
--- a/drivers/s390/char/keyboard.h
+++ b/drivers/s390/char/keyboard.h
@@ -43,22 +43,14 @@ int kbd_ioctl(struct kbd_data *, unsigned int, unsigned long);
43static inline void 43static inline void
44kbd_put_queue(struct tty_port *port, int ch) 44kbd_put_queue(struct tty_port *port, int ch)
45{ 45{
46 struct tty_struct *tty = tty_port_tty_get(port);
47 if (!tty)
48 return;
49 tty_insert_flip_char(port, ch, 0); 46 tty_insert_flip_char(port, ch, 0);
50 tty_schedule_flip(tty); 47 tty_schedule_flip(port);
51 tty_kref_put(tty);
52} 48}
53 49
54static inline void 50static inline void
55kbd_puts_queue(struct tty_port *port, char *cp) 51kbd_puts_queue(struct tty_port *port, char *cp)
56{ 52{
57 struct tty_struct *tty = tty_port_tty_get(port);
58 if (!tty)
59 return;
60 while (*cp) 53 while (*cp)
61 tty_insert_flip_char(port, *cp++, 0); 54 tty_insert_flip_char(port, *cp++, 0);
62 tty_schedule_flip(tty); 55 tty_schedule_flip(port);
63 tty_kref_put(tty);
64} 56}
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c
index df29a3de29f2..b1bb1a6abe81 100644
--- a/drivers/staging/serqt_usb2/serqt_usb2.c
+++ b/drivers/staging/serqt_usb2/serqt_usb2.c
@@ -356,7 +356,6 @@ static void qt_read_bulk_callback(struct urb *urb)
356 struct usb_serial_port *port = urb->context; 356 struct usb_serial_port *port = urb->context;
357 struct usb_serial *serial = get_usb_serial(port, __func__); 357 struct usb_serial *serial = get_usb_serial(port, __func__);
358 struct quatech_port *qt_port = qt_get_port_private(port); 358 struct quatech_port *qt_port = qt_get_port_private(port);
359 struct tty_struct *tty;
360 int result; 359 int result;
361 360
362 if (urb->status) { 361 if (urb->status) {
@@ -367,27 +366,23 @@ static void qt_read_bulk_callback(struct urb *urb)
367 return; 366 return;
368 } 367 }
369 368
370 tty = tty_port_tty_get(&port->port);
371 if (!tty)
372 return;
373
374 dev_dbg(&port->dev, 369 dev_dbg(&port->dev,
375 "%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding); 370 "%s - port->RxHolding = %d\n", __func__, qt_port->RxHolding);
376 371
377 if (port_paranoia_check(port, __func__) != 0) { 372 if (port_paranoia_check(port, __func__) != 0) {
378 qt_port->ReadBulkStopped = 1; 373 qt_port->ReadBulkStopped = 1;
379 goto exit; 374 return;
380 } 375 }
381 376
382 if (!serial) 377 if (!serial)
383 goto exit; 378 return;
384 379
385 if (qt_port->closePending == 1) { 380 if (qt_port->closePending == 1) {
386 /* Were closing , stop reading */ 381 /* Were closing , stop reading */
387 dev_dbg(&port->dev, 382 dev_dbg(&port->dev,
388 "%s - (qt_port->closepending == 1\n", __func__); 383 "%s - (qt_port->closepending == 1\n", __func__);
389 qt_port->ReadBulkStopped = 1; 384 qt_port->ReadBulkStopped = 1;
390 goto exit; 385 return;
391 } 386 }
392 387
393 /* 388 /*
@@ -397,7 +392,7 @@ static void qt_read_bulk_callback(struct urb *urb)
397 */ 392 */
398 if (qt_port->RxHolding == 1) { 393 if (qt_port->RxHolding == 1) {
399 qt_port->ReadBulkStopped = 1; 394 qt_port->ReadBulkStopped = 1;
400 goto exit; 395 return;
401 } 396 }
402 397
403 if (urb->status) { 398 if (urb->status) {
@@ -406,7 +401,7 @@ static void qt_read_bulk_callback(struct urb *urb)
406 dev_dbg(&port->dev, 401 dev_dbg(&port->dev,
407 "%s - nonzero read bulk status received: %d\n", 402 "%s - nonzero read bulk status received: %d\n",
408 __func__, urb->status); 403 __func__, urb->status);
409 goto exit; 404 return;
410 } 405 }
411 406
412 if (urb->actual_length) 407 if (urb->actual_length)
@@ -427,13 +422,11 @@ static void qt_read_bulk_callback(struct urb *urb)
427 else { 422 else {
428 if (urb->actual_length) { 423 if (urb->actual_length) {
429 tty_flip_buffer_push(&port->port); 424 tty_flip_buffer_push(&port->port);
430 tty_schedule_flip(tty); 425 tty_schedule_flip(&port->port);
431 } 426 }
432 } 427 }
433 428
434 schedule_work(&port->work); 429 schedule_work(&port->work);
435exit:
436 tty_kref_put(tty);
437} 430}
438 431
439/* 432/*
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index d1fe9a1f8475..42a329b8af9f 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -441,7 +441,6 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
441 void __iomem *base_addr) 441 void __iomem *base_addr)
442{ 442{
443 struct cyclades_port *info; 443 struct cyclades_port *info;
444 struct tty_struct *tty;
445 struct tty_port *port; 444 struct tty_port *port;
446 int len, index = cinfo->bus_index; 445 int len, index = cinfo->bus_index;
447 u8 ivr, save_xir, channel, save_car, data, char_count; 446 u8 ivr, save_xir, channel, save_car, data, char_count;
@@ -458,18 +457,6 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
458 cyy_writeb(info, CyCAR, save_xir); 457 cyy_writeb(info, CyCAR, save_xir);
459 ivr = cyy_readb(info, CyRIVR) & CyIVRMask; 458 ivr = cyy_readb(info, CyRIVR) & CyIVRMask;
460 459
461 tty = tty_port_tty_get(port);
462 /* if there is nowhere to put the data, discard it */
463 if (tty == NULL) {
464 if (ivr == CyIVRRxEx) { /* exception */
465 data = cyy_readb(info, CyRDSR);
466 } else { /* normal character reception */
467 char_count = cyy_readb(info, CyRDCR);
468 while (char_count--)
469 data = cyy_readb(info, CyRDSR);
470 }
471 goto end;
472 }
473 /* there is an open port for this data */ 460 /* there is an open port for this data */
474 if (ivr == CyIVRRxEx) { /* exception */ 461 if (ivr == CyIVRRxEx) { /* exception */
475 data = cyy_readb(info, CyRDSR); 462 data = cyy_readb(info, CyRDSR);
@@ -486,7 +473,6 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
486 473
487 if (data & info->ignore_status_mask) { 474 if (data & info->ignore_status_mask) {
488 info->icount.rx++; 475 info->icount.rx++;
489 tty_kref_put(tty);
490 return; 476 return;
491 } 477 }
492 if (tty_buffer_request_room(port, 1)) { 478 if (tty_buffer_request_room(port, 1)) {
@@ -496,8 +482,14 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
496 cyy_readb(info, CyRDSR), 482 cyy_readb(info, CyRDSR),
497 TTY_BREAK); 483 TTY_BREAK);
498 info->icount.rx++; 484 info->icount.rx++;
499 if (port->flags & ASYNC_SAK) 485 if (port->flags & ASYNC_SAK) {
500 do_SAK(tty); 486 struct tty_struct *tty =
487 tty_port_tty_get(port);
488 if (tty) {
489 do_SAK(tty);
490 tty_kref_put(tty);
491 }
492 }
501 } else if (data & CyFRAME) { 493 } else if (data & CyFRAME) {
502 tty_insert_flip_char(port, 494 tty_insert_flip_char(port,
503 cyy_readb(info, CyRDSR), 495 cyy_readb(info, CyRDSR),
@@ -566,9 +558,8 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
566 } 558 }
567 info->idle_stats.recv_idle = jiffies; 559 info->idle_stats.recv_idle = jiffies;
568 } 560 }
569 tty_schedule_flip(tty); 561 tty_schedule_flip(port);
570 tty_kref_put(tty); 562
571end:
572 /* end of service */ 563 /* end of service */
573 cyy_writeb(info, CyRIR, save_xir & 0x3f); 564 cyy_writeb(info, CyRIR, save_xir & 0x3f);
574 cyy_writeb(info, CyCAR, save_car); 565 cyy_writeb(info, CyCAR, save_car);
@@ -1012,7 +1003,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty)
1012 jiffies + 1); 1003 jiffies + 1);
1013#endif 1004#endif
1014 info->idle_stats.recv_idle = jiffies; 1005 info->idle_stats.recv_idle = jiffies;
1015 tty_schedule_flip(tty); 1006 tty_schedule_flip(&info->port);
1016 } 1007 }
1017 /* Update rx_get */ 1008 /* Update rx_get */
1018 cy_writel(&buf_ctrl->rx_get, new_rx_get); 1009 cy_writel(&buf_ctrl->rx_get, new_rx_get);
@@ -1191,7 +1182,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
1191 if (delta_count) 1182 if (delta_count)
1192 wake_up_interruptible(&info->port.delta_msr_wait); 1183 wake_up_interruptible(&info->port.delta_msr_wait);
1193 if (special_count) 1184 if (special_count)
1194 tty_schedule_flip(tty); 1185 tty_schedule_flip(&info->port);
1195 tty_kref_put(tty); 1186 tty_kref_put(tty);
1196 } 1187 }
1197} 1188}
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index f42492db31c9..adeac255e526 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -1405,7 +1405,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
1405 if (inited && !test_bit(TTY_THROTTLED, &tty->flags) && 1405 if (inited && !test_bit(TTY_THROTTLED, &tty->flags) &&
1406 MoxaPortRxQueue(p) > 0) { /* RX */ 1406 MoxaPortRxQueue(p) > 0) { /* RX */
1407 MoxaPortReadData(p); 1407 MoxaPortReadData(p);
1408 tty_schedule_flip(tty); 1408 tty_schedule_flip(&p->port);
1409 } 1409 }
1410 } else { 1410 } else {
1411 clear_bit(EMPTYWAIT, &p->statusflags); 1411 clear_bit(EMPTYWAIT, &p->statusflags);
@@ -1430,7 +1430,7 @@ static int moxa_poll_port(struct moxa_port *p, unsigned int handle,
1430 1430
1431 if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */ 1431 if (tty && (intr & IntrBreak) && !I_IGNBRK(tty)) { /* BREAK */
1432 tty_insert_flip_char(&p->port, 0, TTY_BREAK); 1432 tty_insert_flip_char(&p->port, 0, TTY_BREAK);
1433 tty_schedule_flip(tty); 1433 tty_schedule_flip(&p->port);
1434 } 1434 }
1435 1435
1436 if (intr & IntrLine) 1436 if (intr & IntrLine)
diff --git a/drivers/tty/serial/68328serial.c b/drivers/tty/serial/68328serial.c
index 3719273cf0be..641a5a4d73d9 100644
--- a/drivers/tty/serial/68328serial.c
+++ b/drivers/tty/serial/68328serial.c
@@ -262,8 +262,7 @@ static void rs_start(struct tty_struct *tty)
262 local_irq_restore(flags); 262 local_irq_restore(flags);
263} 263}
264 264
265static void receive_chars(struct m68k_serial *info, struct tty_struct *tty, 265static void receive_chars(struct m68k_serial *info, unsigned short rx)
266 unsigned short rx)
267{ 266{
268 m68328_uart *uart = &uart_addr[info->line]; 267 m68328_uart *uart = &uart_addr[info->line];
269 unsigned char ch, flag; 268 unsigned char ch, flag;
@@ -293,9 +292,6 @@ static void receive_chars(struct m68k_serial *info, struct tty_struct *tty,
293 } 292 }
294 } 293 }
295 294
296 if(!tty)
297 goto clear_and_exit;
298
299 flag = TTY_NORMAL; 295 flag = TTY_NORMAL;
300 296
301 if (rx & URX_PARITY_ERROR) 297 if (rx & URX_PARITY_ERROR)
@@ -310,10 +306,7 @@ static void receive_chars(struct m68k_serial *info, struct tty_struct *tty,
310 } while((rx = uart->urx.w) & URX_DATA_READY); 306 } while((rx = uart->urx.w) & URX_DATA_READY);
311#endif 307#endif
312 308
313 tty_schedule_flip(tty); 309 tty_schedule_flip(&info->tport);
314
315clear_and_exit:
316 return;
317} 310}
318 311
319static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty) 312static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty)
@@ -367,11 +360,11 @@ irqreturn_t rs_interrupt(int irq, void *dev_id)
367 tx = uart->utx.w; 360 tx = uart->utx.w;
368 361
369 if (rx & URX_DATA_READY) 362 if (rx & URX_DATA_READY)
370 receive_chars(info, tty, rx); 363 receive_chars(info, rx);
371 if (tx & UTX_TX_AVAIL) 364 if (tx & UTX_TX_AVAIL)
372 transmit_chars(info, tty); 365 transmit_chars(info, tty);
373#else 366#else
374 receive_chars(info, tty, rx); 367 receive_chars(info, rx);
375#endif 368#endif
376 tty_kref_put(tty); 369 tty_kref_put(tty);
377 370
diff --git a/drivers/tty/serial/lpc32xx_hs.c b/drivers/tty/serial/lpc32xx_hs.c
index c8448e6f52e5..c01b58f3729c 100644
--- a/drivers/tty/serial/lpc32xx_hs.c
+++ b/drivers/tty/serial/lpc32xx_hs.c
@@ -323,7 +323,6 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
323{ 323{
324 struct uart_port *port = dev_id; 324 struct uart_port *port = dev_id;
325 struct tty_port *port = &port->state->port; 325 struct tty_port *port = &port->state->port;
326 struct tty_struct *tty = tty_port_tty_get(tport);
327 u32 status; 326 u32 status;
328 327
329 spin_lock(&port->lock); 328 spin_lock(&port->lock);
@@ -348,9 +347,7 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
348 LPC32XX_HSUART_IIR(port->membase)); 347 LPC32XX_HSUART_IIR(port->membase));
349 port->icount.overrun++; 348 port->icount.overrun++;
350 tty_insert_flip_char(tport, 0, TTY_OVERRUN); 349 tty_insert_flip_char(tport, 0, TTY_OVERRUN);
351 if (tty) { 350 tty_schedule_flip(tport);
352 tty_schedule_flip(tty);
353 }
354 } 351 }
355 352
356 /* Data received? */ 353 /* Data received? */
@@ -366,7 +363,6 @@ static irqreturn_t serial_lpc32xx_interrupt(int irq, void *dev_id)
366 } 363 }
367 364
368 spin_unlock(&port->lock); 365 spin_unlock(&port->lock);
369 tty_kref_put(tty);
370 366
371 return IRQ_HANDLED; 367 return IRQ_HANDLED;
372} 368}
diff --git a/drivers/tty/tty_buffer.c b/drivers/tty/tty_buffer.c
index b6efacadf23b..d6969f6e4c43 100644
--- a/drivers/tty/tty_buffer.c
+++ b/drivers/tty/tty_buffer.c
@@ -349,7 +349,7 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);
349 349
350/** 350/**
351 * tty_schedule_flip - push characters to ldisc 351 * tty_schedule_flip - push characters to ldisc
352 * @tty: tty to push from 352 * @port: tty port to push from
353 * 353 *
354 * Takes any pending buffers and transfers their ownership to the 354 * Takes any pending buffers and transfers their ownership to the
355 * ldisc side of the queue. It then schedules those characters for 355 * ldisc side of the queue. It then schedules those characters for
@@ -360,11 +360,11 @@ EXPORT_SYMBOL(tty_insert_flip_string_flags);
360 * Locking: Takes port->buf.lock 360 * Locking: Takes port->buf.lock
361 */ 361 */
362 362
363void tty_schedule_flip(struct tty_struct *tty) 363void tty_schedule_flip(struct tty_port *port)
364{ 364{
365 struct tty_bufhead *buf = &tty->port->buf; 365 struct tty_bufhead *buf = &port->buf;
366 unsigned long flags; 366 unsigned long flags;
367 WARN_ON(tty->port->low_latency); 367 WARN_ON(port->low_latency);
368 368
369 spin_lock_irqsave(&buf->lock, flags); 369 spin_lock_irqsave(&buf->lock, flags);
370 if (buf->tail != NULL) 370 if (buf->tail != NULL)
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 5aace4d47cb6..a9af1b9ae160 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -307,26 +307,17 @@ int kbd_rate(struct kbd_repeat *rep)
307 */ 307 */
308static void put_queue(struct vc_data *vc, int ch) 308static void put_queue(struct vc_data *vc, int ch)
309{ 309{
310 struct tty_struct *tty = vc->port.tty;
311
312 tty_insert_flip_char(&vc->port, ch, 0); 310 tty_insert_flip_char(&vc->port, ch, 0);
313 if (tty) { 311 tty_schedule_flip(&vc->port);
314 tty_schedule_flip(tty);
315 }
316} 312}
317 313
318static void puts_queue(struct vc_data *vc, char *cp) 314static void puts_queue(struct vc_data *vc, char *cp)
319{ 315{
320 struct tty_struct *tty = vc->port.tty;
321
322 if (!tty)
323 return;
324
325 while (*cp) { 316 while (*cp) {
326 tty_insert_flip_char(&vc->port, *cp, 0); 317 tty_insert_flip_char(&vc->port, *cp, 0);
327 cp++; 318 cp++;
328 } 319 }
329 tty_schedule_flip(tty); 320 tty_schedule_flip(&vc->port);
330} 321}
331 322
332static void applkey(struct vc_data *vc, int key, char mode) 323static void applkey(struct vc_data *vc, int key, char mode)
@@ -582,12 +573,8 @@ static void fn_inc_console(struct vc_data *vc)
582 573
583static void fn_send_intr(struct vc_data *vc) 574static void fn_send_intr(struct vc_data *vc)
584{ 575{
585 struct tty_struct *tty = vc->port.tty;
586
587 if (!tty)
588 return;
589 tty_insert_flip_char(&vc->port, 0, TTY_BREAK); 576 tty_insert_flip_char(&vc->port, 0, TTY_BREAK);
590 tty_schedule_flip(tty); 577 tty_schedule_flip(&vc->port);
591} 578}
592 579
593static void fn_scroll_forw(struct vc_data *vc) 580static void fn_scroll_forw(struct vc_data *vc)
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 811f2505e9ee..1a2728034599 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1333,13 +1333,13 @@ static void csi_m(struct vc_data *vc)
1333 update_attr(vc); 1333 update_attr(vc);
1334} 1334}
1335 1335
1336static void respond_string(const char *p, struct tty_struct *tty) 1336static void respond_string(const char *p, struct tty_port *port)
1337{ 1337{
1338 while (*p) { 1338 while (*p) {
1339 tty_insert_flip_char(tty->port, *p, 0); 1339 tty_insert_flip_char(port, *p, 0);
1340 p++; 1340 p++;
1341 } 1341 }
1342 tty_schedule_flip(tty); 1342 tty_schedule_flip(port);
1343} 1343}
1344 1344
1345static void cursor_report(struct vc_data *vc, struct tty_struct *tty) 1345static void cursor_report(struct vc_data *vc, struct tty_struct *tty)
@@ -1347,17 +1347,17 @@ static void cursor_report(struct vc_data *vc, struct tty_struct *tty)
1347 char buf[40]; 1347 char buf[40];
1348 1348
1349 sprintf(buf, "\033[%d;%dR", vc->vc_y + (vc->vc_decom ? vc->vc_top + 1 : 1), vc->vc_x + 1); 1349 sprintf(buf, "\033[%d;%dR", vc->vc_y + (vc->vc_decom ? vc->vc_top + 1 : 1), vc->vc_x + 1);
1350 respond_string(buf, tty); 1350 respond_string(buf, tty->port);
1351} 1351}
1352 1352
1353static inline void status_report(struct tty_struct *tty) 1353static inline void status_report(struct tty_struct *tty)
1354{ 1354{
1355 respond_string("\033[0n", tty); /* Terminal ok */ 1355 respond_string("\033[0n", tty->port); /* Terminal ok */
1356} 1356}
1357 1357
1358static inline void respond_ID(struct tty_struct * tty) 1358static inline void respond_ID(struct tty_struct *tty)
1359{ 1359{
1360 respond_string(VT102ID, tty); 1360 respond_string(VT102ID, tty->port);
1361} 1361}
1362 1362
1363void mouse_report(struct tty_struct *tty, int butt, int mrx, int mry) 1363void mouse_report(struct tty_struct *tty, int butt, int mrx, int mry)
@@ -1366,7 +1366,7 @@ void mouse_report(struct tty_struct *tty, int butt, int mrx, int mry)
1366 1366
1367 sprintf(buf, "\033[M%c%c%c", (char)(' ' + butt), (char)('!' + mrx), 1367 sprintf(buf, "\033[M%c%c%c", (char)(' ' + butt), (char)('!' + mrx),
1368 (char)('!' + mry)); 1368 (char)('!' + mry));
1369 respond_string(buf, tty); 1369 respond_string(buf, tty->port);
1370} 1370}
1371 1371
1372/* invoked via ioctl(TIOCLINUX) and through set_selection */ 1372/* invoked via ioctl(TIOCLINUX) and through set_selection */
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h
index c5572807633a..e0f252633b47 100644
--- a/include/linux/tty_flip.h
+++ b/include/linux/tty_flip.h
@@ -11,7 +11,7 @@ extern int tty_prepare_flip_string(struct tty_port *port,
11extern int tty_prepare_flip_string_flags(struct tty_port *port, 11extern int tty_prepare_flip_string_flags(struct tty_port *port,
12 unsigned char **chars, char **flags, size_t size); 12 unsigned char **chars, char **flags, size_t size);
13extern void tty_flip_buffer_push(struct tty_port *port); 13extern void tty_flip_buffer_push(struct tty_port *port);
14void tty_schedule_flip(struct tty_struct *tty); 14void tty_schedule_flip(struct tty_port *port);
15 15
16static inline int tty_insert_flip_char(struct tty_port *port, 16static inline int tty_insert_flip_char(struct tty_port *port,
17 unsigned char ch, char flag) 17 unsigned char ch, char flag)