diff options
author | Jiri Slaby <jslaby@suse.cz> | 2013-01-03 09:53:06 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-16 01:30:15 -0500 |
commit | 2e124b4a390ca85325fae75764bef92f0547fa25 (patch) | |
tree | 5519fbcdbe954e79b271ea6d31ac5a4dc754c4f5 /drivers/usb/serial/usb_wwan.c | |
parent | d6c53c0e9bd0a83f9f9ddbc9fd80141a54d83896 (diff) |
TTY: switch tty_flip_buffer_push
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.
Now, the one where most of tty_port_tty_get gets removed:
tty_flip_buffer_push.
IOW we also closed all the races in drivers not using tty_port_tty_get
at all yet.
Also we move tty_flip_buffer_push declaration from include/linux/tty.h
to include/linux/tty_flip.h to all others while we are changing it
anyway.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb_wwan.c')
-rw-r--r-- | drivers/usb/serial/usb_wwan.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 293b460030cb..a547c91e3c05 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c | |||
@@ -275,7 +275,6 @@ static void usb_wwan_indat_callback(struct urb *urb) | |||
275 | int err; | 275 | int err; |
276 | int endpoint; | 276 | int endpoint; |
277 | struct usb_serial_port *port; | 277 | struct usb_serial_port *port; |
278 | struct tty_struct *tty; | ||
279 | struct device *dev; | 278 | struct device *dev; |
280 | unsigned char *data = urb->transfer_buffer; | 279 | unsigned char *data = urb->transfer_buffer; |
281 | int status = urb->status; | 280 | int status = urb->status; |
@@ -288,16 +287,12 @@ static void usb_wwan_indat_callback(struct urb *urb) | |||
288 | dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n", | 287 | dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n", |
289 | __func__, status, endpoint); | 288 | __func__, status, endpoint); |
290 | } else { | 289 | } else { |
291 | tty = tty_port_tty_get(&port->port); | 290 | if (urb->actual_length) { |
292 | if (tty) { | 291 | tty_insert_flip_string(&port->port, data, |
293 | if (urb->actual_length) { | 292 | urb->actual_length); |
294 | tty_insert_flip_string(&port->port, data, | 293 | tty_flip_buffer_push(&port->port); |
295 | urb->actual_length); | 294 | } else |
296 | tty_flip_buffer_push(tty); | 295 | dev_dbg(dev, "%s: empty read urb received\n", __func__); |
297 | } else | ||
298 | dev_dbg(dev, "%s: empty read urb received\n", __func__); | ||
299 | tty_kref_put(tty); | ||
300 | } | ||
301 | 296 | ||
302 | /* Resubmit urb so we continue receiving */ | 297 | /* Resubmit urb so we continue receiving */ |
303 | err = usb_submit_urb(urb, GFP_ATOMIC); | 298 | err = usb_submit_urb(urb, GFP_ATOMIC); |