aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/pl2303.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 17:55:12 -0500
commit1f87158e44e79e62c8250f278c225ce4ab695f4b (patch)
treeeff328f63a75993a3e1ffbba9c9f0ba1fecf0edb /drivers/usb/serial/pl2303.c
parenta108bfcb372d8c4452701039308fb95747911c59 (diff)
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/pl2303.c')
-rw-r--r--drivers/usb/serial/pl2303.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
index a3e5a56dc066..571dcf182866 100644
--- a/drivers/usb/serial/pl2303.c
+++ b/drivers/usb/serial/pl2303.c
@@ -1071,10 +1071,6 @@ static void pl2303_read_bulk_callback(struct urb *urb)
1071 1071
1072 if (status) { 1072 if (status) {
1073 dbg("%s - urb status = %d", __func__, status); 1073 dbg("%s - urb status = %d", __func__, status);
1074 if (!port->port.count) {
1075 dbg("%s - port is closed, exiting.", __func__);
1076 return;
1077 }
1078 if (status == -EPROTO) { 1074 if (status == -EPROTO) {
1079 /* PL2303 mysteriously fails with -EPROTO reschedule 1075 /* PL2303 mysteriously fails with -EPROTO reschedule
1080 * the read */ 1076 * the read */
@@ -1107,15 +1103,11 @@ static void pl2303_read_bulk_callback(struct urb *urb)
1107 } 1103 }
1108 tty_kref_put(tty); 1104 tty_kref_put(tty);
1109 /* Schedule the next read _if_ we are still open */ 1105 /* Schedule the next read _if_ we are still open */
1110 if (port->port.count) { 1106 urb->dev = port->serial->dev;
1111 urb->dev = port->serial->dev; 1107 result = usb_submit_urb(urb, GFP_ATOMIC);
1112 result = usb_submit_urb(urb, GFP_ATOMIC); 1108 if (result && result != -EPERM)
1113 if (result) 1109 dev_err(&urb->dev->dev, "%s - failed resubmitting"
1114 dev_err(&urb->dev->dev, "%s - failed resubmitting" 1110 " read urb, error %d\n", __func__, result);
1115 " read urb, error %d\n", __func__, result);
1116 }
1117
1118 return;
1119} 1111}
1120 1112
1121static void pl2303_write_bulk_callback(struct urb *urb) 1113static void pl2303_write_bulk_callback(struct urb *urb)