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>
This commit is contained in:
Alan Stern
2010-02-17 10:05:47 -05:00
committed by Greg Kroah-Hartman
parent a108bfcb37
commit 1f87158e44
11 changed files with 65 additions and 125 deletions

View File

@@ -1071,10 +1071,6 @@ static void pl2303_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) {
/* PL2303 mysteriously fails with -EPROTO reschedule
* the read */
@@ -1107,15 +1103,11 @@ static void pl2303_read_bulk_callback(struct urb *urb)
}
tty_kref_put(tty);
/* Schedule the next read _if_ we are still open */
if (port->port.count) {
urb->dev = port->serial->dev;
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;
urb->dev = port->serial->dev;
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);
}
static void pl2303_write_bulk_callback(struct urb *urb)