diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 15:53:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-15 22:17:28 -0800 |
commit | 227434f8986c3827a1faedd1feb437acd6285315 (patch) | |
tree | e96f6c6a800b81d096be73c1b7943c7aa24aa632 /drivers/tty/cyclades.c | |
parent | ea28fd56fcde69af768135e428093f94c5ca6a88 (diff) |
TTY: switch tty_buffer_request_room to tty_port
Now, we start converting tty buffer functions to actually use
tty_port. This will allow us to get rid of the need of tty pointer in
many call sites. Only tty_port will be needed and hence no more
tty_port_tty_get calls in those paths.
Here we start with tty_buffer_request_room.
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 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index b09c8d1f9a66..b85acc74eb0d 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c @@ -442,6 +442,7 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, { 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; @@ -452,11 +453,12 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, save_xir = readb(base_addr + (CyRIR << index)); channel = save_xir & CyIRChannel; info = &cinfo->ports[channel + chip * 4]; + port = &info->port; save_car = cyy_readb(info, CyCAR); cyy_writeb(info, CyCAR, save_xir); ivr = cyy_readb(info, CyRIVR) & CyIVRMask; - tty = tty_port_tty_get(&info->port); + tty = tty_port_tty_get(port); /* if there is nowhere to put the data, discard it */ if (tty == NULL) { if (ivr == CyIVRRxEx) { /* exception */ @@ -487,14 +489,14 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, tty_kref_put(tty); return; } - if (tty_buffer_request_room(tty, 1)) { + if (tty_buffer_request_room(port, 1)) { if (data & info->read_status_mask) { if (data & CyBREAK) { tty_insert_flip_char(tty, cyy_readb(info, CyRDSR), TTY_BREAK); info->icount.rx++; - if (info->port.flags & ASYNC_SAK) + if (port->flags & ASYNC_SAK) do_SAK(tty); } else if (data & CyFRAME) { tty_insert_flip_char(tty, @@ -552,7 +554,7 @@ static void cyy_chip_rx(struct cyclades_card *cinfo, int chip, info->mon.char_max = char_count; info->mon.char_last = char_count; #endif - len = tty_buffer_request_room(tty, char_count); + len = tty_buffer_request_room(port, char_count); while (len--) { data = cyy_readb(info, CyRDSR); tty_insert_flip_char(tty, data, TTY_NORMAL); @@ -928,6 +930,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty) { struct BUF_CTRL __iomem *buf_ctrl = info->u.cyz.buf_ctrl; struct cyclades_card *cinfo = info->card; + struct tty_port *port = &info->port; unsigned int char_count; int len; #ifdef BLOCKMOVE @@ -983,7 +986,7 @@ static void cyz_handle_rx(struct cyclades_port *info, struct tty_struct *tty) info->idle_stats.recv_bytes += len; } #else - len = tty_buffer_request_room(tty, char_count); + len = tty_buffer_request_room(port, char_count); while (len--) { data = readb(cinfo->base_addr + rx_bufaddr + new_rx_get); |