summaryrefslogtreecommitdiffstats
path: root/drivers/tty/cyclades.c
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2013-01-03 15:53:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-15 22:43:15 -0800
commit6732c8bb8671acbdac6cdc93dd72ddd581dd5e25 (patch)
tree6c70977ee03cddd4211b8f775c331b41532ed5da /drivers/tty/cyclades.c
parent2e124b4a390ca85325fae75764bef92f0547fa25 (diff)
downloadop-kernel-dev-6732c8bb8671acbdac6cdc93dd72ddd581dd5e25.zip
op-kernel-dev-6732c8bb8671acbdac6cdc93dd72ddd581dd5e25.tar.gz
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.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index d1fe9a1..42a329b 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,
void __iomem *base_addr)
{
struct cyclades_port *info;
- struct tty_struct *tty;
struct tty_port *port;
int len, index = cinfo->bus_index;
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,
cyy_writeb(info, CyCAR, save_xir);
ivr = cyy_readb(info, CyRIVR) & CyIVRMask;
- tty = tty_port_tty_get(port);
- /* if there is nowhere to put the data, discard it */
- if (tty == NULL) {
- if (ivr == CyIVRRxEx) { /* exception */
- data = cyy_readb(info, CyRDSR);
- } else { /* normal character reception */
- char_count = cyy_readb(info, CyRDCR);
- while (char_count--)
- data = cyy_readb(info, CyRDSR);
- }
- goto end;
- }
/* there is an open port for this data */
if (ivr == CyIVRRxEx) { /* exception */
data = cyy_readb(info, CyRDSR);
@@ -486,7 +473,6 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
if (data & info->ignore_status_mask) {
info->icount.rx++;
- tty_kref_put(tty);
return;
}
if (tty_buffer_request_room(port, 1)) {
@@ -496,8 +482,14 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
cyy_readb(info, CyRDSR),
TTY_BREAK);
info->icount.rx++;
- if (port->flags & ASYNC_SAK)
- do_SAK(tty);
+ if (port->flags & ASYNC_SAK) {
+ struct tty_struct *tty =
+ tty_port_tty_get(port);
+ if (tty) {
+ do_SAK(tty);
+ tty_kref_put(tty);
+ }
+ }
} else if (data & CyFRAME) {
tty_insert_flip_char(port,
cyy_readb(info, CyRDSR),
@@ -566,9 +558,8 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip,
}
info->idle_stats.recv_idle = jiffies;
}
- tty_schedule_flip(tty);
- tty_kref_put(tty);
-end:
+ tty_schedule_flip(port);
+
/* end of service */
cyy_writeb(info, CyRIR, save_xir & 0x3f);
cyy_writeb(info, CyCAR, save_car);
@@ -1012,7 +1003,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty)
jiffies + 1);
#endif
info->idle_stats.recv_idle = jiffies;
- tty_schedule_flip(tty);
+ tty_schedule_flip(&info->port);
}
/* Update rx_get */
cy_writel(&buf_ctrl->rx_get, new_rx_get);
@@ -1191,7 +1182,7 @@ static void cyz_handle_cmd(struct cyclades_card *cinfo)
if (delta_count)
wake_up_interruptible(&info->port.delta_msr_wait);
if (special_count)
- tty_schedule_flip(tty);
+ tty_schedule_flip(&info->port);
tty_kref_put(tty);
}
}
OpenPOWER on IntegriCloud