aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/aircable.c
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2010-02-17 10:05:47 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-02 14:55:12 -0800
commit1f87158e44e79e62c8250f278c225ce4ab695f4b (patch)
treeeff328f63a75993a3e1ffbba9c9f0ba1fecf0edb /drivers/usb/serial/aircable.c
parenta108bfcb372d8c4452701039308fb95747911c59 (diff)
downloadkernel_samsung_smdk4412-1f87158e44e79e62c8250f278c225ce4ab695f4b.zip
kernel_samsung_smdk4412-1f87158e44e79e62c8250f278c225ce4ab695f4b.tar.gz
kernel_samsung_smdk4412-1f87158e44e79e62c8250f278c225ce4ab695f4b.tar.bz2
USB: remove references to port->port.count from the serial drivers
This patch (as1344) removes references to port->port.count from the USB serial drivers. Now that serial ports are properly reference counted, port.count checking is unnecessary and incorrect. Drivers should assume that the port is in use from the time the open method runs until the close method is called. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/serial/aircable.c')
-rw-r--r--drivers/usb/serial/aircable.c34
1 files changed, 13 insertions, 21 deletions
diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 2cbdc8f..365db10 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -468,10 +468,6 @@ static void aircable_read_bulk_callback(struct urb *urb)
if (status) {
dbg("%s - urb status = %d", __func__, status);
- if (!port->port.count) {
- dbg("%s - port is closed, exiting.", __func__);
- return;
- }
if (status == -EPROTO) {
dbg("%s - caught -EPROTO, resubmitting the urb",
__func__);
@@ -530,23 +526,19 @@ static void aircable_read_bulk_callback(struct urb *urb)
}
tty_kref_put(tty);
- /* Schedule the next read _if_ we are still open */
- if (port->port.count) {
- usb_fill_bulk_urb(port->read_urb, port->serial->dev,
- usb_rcvbulkpipe(port->serial->dev,
- port->bulk_in_endpointAddress),
- port->read_urb->transfer_buffer,
- port->read_urb->transfer_buffer_length,
- aircable_read_bulk_callback, port);
-
- result = usb_submit_urb(urb, GFP_ATOMIC);
- if (result)
- dev_err(&urb->dev->dev,
- "%s - failed resubmitting read urb, error %d\n",
- __func__, result);
- }
-
- return;
+ /* Schedule the next read */
+ usb_fill_bulk_urb(port->read_urb, port->serial->dev,
+ usb_rcvbulkpipe(port->serial->dev,
+ port->bulk_in_endpointAddress),
+ port->read_urb->transfer_buffer,
+ port->read_urb->transfer_buffer_length,
+ aircable_read_bulk_callback, port);
+
+ result = usb_submit_urb(urb, GFP_ATOMIC);
+ if (result && result != -EPERM)
+ dev_err(&urb->dev->dev,
+ "%s - failed resubmitting read urb, error %d\n",
+ __func__, result);
}
/* Based on ftdi_sio.c throttle */