summaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-02-08 13:49:19 +0100
committerJohan Hovold <johan@kernel.org>2017-02-08 19:28:02 +0100
commitacfe27633b4c380a67956bd2f73fc9a2c932cc39 (patch)
treeb5a2c60194ba6dad248c89824b394764fd6c0c22 /drivers/usb
parent168fc6c3c33ee7e9b2355e1a17d07e8313eb60f5 (diff)
USB: serial: metro-usb: drop redundant URB reinitialisation
No need to reinitialise the interrupt-in URB with values that have not changed before (some) resubmissions. This also allows the interrupt-in callback to have a single path for URB resubmission. Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/serial/metro-usb.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/usb/serial/metro-usb.c b/drivers/usb/serial/metro-usb.c
index f220a470197a..cc84da8dbb84 100644
--- a/drivers/usb/serial/metro-usb.c
+++ b/drivers/usb/serial/metro-usb.c
@@ -135,23 +135,8 @@ static void metrousb_read_int_callback(struct urb *urb)
throttled = metro_priv->throttled;
spin_unlock_irqrestore(&metro_priv->lock, flags);
- /* Continue trying to read if set. */
- if (!throttled) {
- usb_fill_int_urb(port->interrupt_in_urb, port->serial->dev,
- usb_rcvintpipe(port->serial->dev, port->interrupt_in_endpointAddress),
- port->interrupt_in_urb->transfer_buffer,
- port->interrupt_in_urb->transfer_buffer_length,
- metrousb_read_int_callback, port, 1);
-
- result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
-
- if (result)
- dev_err(&port->dev,
- "%s - failed submitting interrupt in urb, error code=%d\n",
- __func__, result);
- }
- return;
-
+ if (throttled)
+ return;
exit:
/* Try to resubmit the urb. */
result = usb_submit_urb(urb, GFP_ATOMIC);
@@ -337,7 +322,6 @@ static void metrousb_unthrottle(struct tty_struct *tty)
spin_unlock_irqrestore(&metro_priv->lock, flags);
/* Submit the urb to read from the port. */
- port->interrupt_in_urb->dev = port->serial->dev;
result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC);
if (result)
dev_err(tty->dev,