diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:43:15 -0500 |
commit | 6732c8bb8671acbdac6cdc93dd72ddd581dd5e25 (patch) | |
tree | 6c70977ee03cddd4211b8f775c331b41532ed5da /drivers/tty/cyclades.c | |
parent | 2e124b4a390ca85325fae75764bef92f0547fa25 (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>
Diffstat (limited to 'drivers/tty/cyclades.c')
-rw-r--r-- | drivers/tty/cyclades.c | 33 |
1 files changed, 12 insertions, 21 deletions
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 | |
571 | end: | ||
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 | } |