diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2010-02-17 10:05:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-03-02 17:55:12 -0500 |
commit | 1f87158e44e79e62c8250f278c225ce4ab695f4b (patch) | |
tree | eff328f63a75993a3e1ffbba9c9f0ba1fecf0edb /drivers/usb/serial/oti6858.c | |
parent | a108bfcb372d8c4452701039308fb95747911c59 (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/oti6858.c')
-rw-r--r-- | drivers/usb/serial/oti6858.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index 839733431832..deeacdea05db 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -585,9 +585,6 @@ static int oti6858_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
585 | usb_clear_halt(serial->dev, port->write_urb->pipe); | 585 | usb_clear_halt(serial->dev, port->write_urb->pipe); |
586 | usb_clear_halt(serial->dev, port->read_urb->pipe); | 586 | usb_clear_halt(serial->dev, port->read_urb->pipe); |
587 | 587 | ||
588 | if (port->port.count != 1) | ||
589 | return 0; | ||
590 | |||
591 | buf = kmalloc(OTI6858_CTRL_PKT_SIZE, GFP_KERNEL); | 588 | buf = kmalloc(OTI6858_CTRL_PKT_SIZE, GFP_KERNEL); |
592 | if (buf == NULL) { | 589 | if (buf == NULL) { |
593 | dev_err(&port->dev, "%s(): out of memory!\n", __func__); | 590 | dev_err(&port->dev, "%s(): out of memory!\n", __func__); |
@@ -934,10 +931,6 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
934 | spin_unlock_irqrestore(&priv->lock, flags); | 931 | spin_unlock_irqrestore(&priv->lock, flags); |
935 | 932 | ||
936 | if (status != 0) { | 933 | if (status != 0) { |
937 | if (!port->port.count) { | ||
938 | dbg("%s(): port is closed, exiting", __func__); | ||
939 | return; | ||
940 | } | ||
941 | /* | 934 | /* |
942 | if (status == -EPROTO) { | 935 | if (status == -EPROTO) { |
943 | * PL2303 mysteriously fails with -EPROTO reschedule | 936 | * PL2303 mysteriously fails with -EPROTO reschedule |
@@ -961,14 +954,12 @@ static void oti6858_read_bulk_callback(struct urb *urb) | |||
961 | } | 954 | } |
962 | tty_kref_put(tty); | 955 | tty_kref_put(tty); |
963 | 956 | ||
964 | /* schedule the interrupt urb if we are still open */ | 957 | /* schedule the interrupt urb */ |
965 | if (port->port.count != 0) { | 958 | port->interrupt_in_urb->dev = port->serial->dev; |
966 | port->interrupt_in_urb->dev = port->serial->dev; | 959 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
967 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 960 | if (result != 0 && result != -EPERM) { |
968 | if (result != 0) { | 961 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," |
969 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," | 962 | " error %d\n", __func__, result); |
970 | " error %d\n", __func__, result); | ||
971 | } | ||
972 | } | 963 | } |
973 | } | 964 | } |
974 | 965 | ||