summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/opticon.c
diff options
context:
space:
mode:
authorJohan Hovold <jhovold@gmail.com>2012-11-18 13:23:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-21 13:33:54 -0800
commit0b8718a264f58b096753e29f7e04f188bf64938e (patch)
tree348b0ed3f4f85c210b07009786064593b35bfce4 /drivers/usb/serial/opticon.c
parentf38c46021aaa0871a96bd922ccbcc9d61c4ae49e (diff)
USB: opticon: move private urb initialisation to attach
There no need to reinitialise the private urb at every open. Signed-off-by: Johan Hovold <jhovold@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r--drivers/usb/serial/opticon.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
index cb8674ec5fbb..8c66471f3bff 100644
--- a/drivers/usb/serial/opticon.c
+++ b/drivers/usb/serial/opticon.c
@@ -184,13 +184,6 @@ static int opticon_open(struct tty_struct *tty, struct usb_serial_port *port)
/* Clear RTS line */
send_control_msg(port, CONTROL_RTS, 0);
- /* Setup the read URB and start reading from the device */
- usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev,
- usb_rcvbulkpipe(priv->udev,
- priv->bulk_address),
- priv->bulk_in_buffer, priv->buffer_size,
- opticon_read_bulk_callback, priv);
-
/* clear the halt status of the enpoint */
usb_clear_halt(priv->udev, priv->bulk_read_urb->pipe);
@@ -530,6 +523,12 @@ static int opticon_startup(struct usb_serial *serial)
goto error;
}
+ usb_fill_bulk_urb(priv->bulk_read_urb, serial->dev,
+ usb_rcvbulkpipe(serial->dev,
+ priv->bulk_address),
+ priv->bulk_in_buffer, priv->buffer_size,
+ opticon_read_bulk_callback, priv);
+
usb_set_serial_data(serial, priv);
return 0;