diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:17:28 -0500 |
commit | 227434f8986c3827a1faedd1feb437acd6285315 (patch) | |
tree | e96f6c6a800b81d096be73c1b7943c7aa24aa632 /drivers/isdn/i4l | |
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/isdn/i4l')
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 3 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_tty.c | 12 |
2 files changed, 9 insertions, 6 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index e2a945ee9f05..7093169ee0c9 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -878,6 +878,7 @@ isdn_readbchan(int di, int channel, u_char *buf, u_char *fp, int len, wait_queue | |||
878 | int | 878 | int |
879 | isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) | 879 | isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) |
880 | { | 880 | { |
881 | struct tty_port *port = tty->port; | ||
881 | int count; | 882 | int count; |
882 | int count_pull; | 883 | int count_pull; |
883 | int count_put; | 884 | int count_put; |
@@ -891,7 +892,7 @@ isdn_readbchan_tty(int di, int channel, struct tty_struct *tty, int cisco_hack) | |||
891 | if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) | 892 | if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) |
892 | return 0; | 893 | return 0; |
893 | 894 | ||
894 | len = tty_buffer_request_room(tty, dev->drv[di]->rcvcount[channel]); | 895 | len = tty_buffer_request_room(port, dev->drv[di]->rcvcount[channel]); |
895 | if (len == 0) | 896 | if (len == 0) |
896 | return len; | 897 | return len; |
897 | 898 | ||
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index e09dc8a5e743..4f5bcee7cf32 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -60,6 +60,7 @@ static int si2bit[8] = | |||
60 | static int | 60 | static int |
61 | isdn_tty_try_read(modem_info *info, struct sk_buff *skb) | 61 | isdn_tty_try_read(modem_info *info, struct sk_buff *skb) |
62 | { | 62 | { |
63 | struct tty_port *port = &info->port; | ||
63 | int c; | 64 | int c; |
64 | int len; | 65 | int len; |
65 | struct tty_struct *tty; | 66 | struct tty_struct *tty; |
@@ -68,7 +69,7 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb) | |||
68 | if (!info->online) | 69 | if (!info->online) |
69 | return 0; | 70 | return 0; |
70 | 71 | ||
71 | tty = info->port.tty; | 72 | tty = port->tty; |
72 | if (!tty) | 73 | if (!tty) |
73 | return 0; | 74 | return 0; |
74 | 75 | ||
@@ -81,7 +82,7 @@ isdn_tty_try_read(modem_info *info, struct sk_buff *skb) | |||
81 | #endif | 82 | #endif |
82 | ; | 83 | ; |
83 | 84 | ||
84 | c = tty_buffer_request_room(tty, len); | 85 | c = tty_buffer_request_room(port, len); |
85 | if (c < len) | 86 | if (c < len) |
86 | return 0; | 87 | return 0; |
87 | 88 | ||
@@ -2230,6 +2231,7 @@ void | |||
2230 | isdn_tty_at_cout(char *msg, modem_info *info) | 2231 | isdn_tty_at_cout(char *msg, modem_info *info) |
2231 | { | 2232 | { |
2232 | struct tty_struct *tty; | 2233 | struct tty_struct *tty; |
2234 | struct tty_port *port = &info->port; | ||
2233 | atemu *m = &info->emu; | 2235 | atemu *m = &info->emu; |
2234 | char *p; | 2236 | char *p; |
2235 | char c; | 2237 | char c; |
@@ -2246,15 +2248,15 @@ isdn_tty_at_cout(char *msg, modem_info *info) | |||
2246 | l = strlen(msg); | 2248 | l = strlen(msg); |
2247 | 2249 | ||
2248 | spin_lock_irqsave(&info->readlock, flags); | 2250 | spin_lock_irqsave(&info->readlock, flags); |
2249 | tty = info->port.tty; | 2251 | tty = port->tty; |
2250 | if ((info->port.flags & ASYNC_CLOSING) || (!tty)) { | 2252 | if ((port->flags & ASYNC_CLOSING) || (!tty)) { |
2251 | spin_unlock_irqrestore(&info->readlock, flags); | 2253 | spin_unlock_irqrestore(&info->readlock, flags); |
2252 | return; | 2254 | return; |
2253 | } | 2255 | } |
2254 | 2256 | ||
2255 | /* use queue instead of direct, if online and */ | 2257 | /* use queue instead of direct, if online and */ |
2256 | /* data is in queue or buffer is full */ | 2258 | /* data is in queue or buffer is full */ |
2257 | if (info->online && ((tty_buffer_request_room(tty, l) < l) || | 2259 | if (info->online && ((tty_buffer_request_room(port, l) < l) || |
2258 | !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) { | 2260 | !skb_queue_empty(&dev->drv[info->isdn_driver]->rpqueue[info->isdn_channel]))) { |
2259 | skb = alloc_skb(l, GFP_ATOMIC); | 2261 | skb = alloc_skb(l, GFP_ATOMIC); |
2260 | if (!skb) { | 2262 | if (!skb) { |