diff options
author | Johan Hovold <jhovold@gmail.com> | 2012-11-18 07:23:22 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-11-21 16:33:54 -0500 |
commit | 0b8718a264f58b096753e29f7e04f188bf64938e (patch) | |
tree | 348b0ed3f4f85c210b07009786064593b35bfce4 /drivers/usb/serial | |
parent | f38c46021aaa0871a96bd922ccbcc9d61c4ae49e (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')
-rw-r--r-- | drivers/usb/serial/opticon.c | 13 |
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) | |||
184 | /* Clear RTS line */ | 184 | /* Clear RTS line */ |
185 | send_control_msg(port, CONTROL_RTS, 0); | 185 | send_control_msg(port, CONTROL_RTS, 0); |
186 | 186 | ||
187 | /* Setup the read URB and start reading from the device */ | ||
188 | usb_fill_bulk_urb(priv->bulk_read_urb, priv->udev, | ||
189 | usb_rcvbulkpipe(priv->udev, | ||
190 | priv->bulk_address), | ||
191 | priv->bulk_in_buffer, priv->buffer_size, | ||
192 | opticon_read_bulk_callback, priv); | ||
193 | |||
194 | /* clear the halt status of the enpoint */ | 187 | /* clear the halt status of the enpoint */ |
195 | usb_clear_halt(priv->udev, priv->bulk_read_urb->pipe); | 188 | usb_clear_halt(priv->udev, priv->bulk_read_urb->pipe); |
196 | 189 | ||
@@ -530,6 +523,12 @@ static int opticon_startup(struct usb_serial *serial) | |||
530 | goto error; | 523 | goto error; |
531 | } | 524 | } |
532 | 525 | ||
526 | usb_fill_bulk_urb(priv->bulk_read_urb, serial->dev, | ||
527 | usb_rcvbulkpipe(serial->dev, | ||
528 | priv->bulk_address), | ||
529 | priv->bulk_in_buffer, priv->buffer_size, | ||
530 | opticon_read_bulk_callback, priv); | ||
531 | |||
533 | usb_set_serial_data(serial, priv); | 532 | usb_set_serial_data(serial, priv); |
534 | return 0; | 533 | return 0; |
535 | 534 | ||