diff options
author | Johan Hovold <johan@kernel.org> | 2017-02-08 07:49:19 -0500 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-02-08 13:28:02 -0500 |
commit | acfe27633b4c380a67956bd2f73fc9a2c932cc39 (patch) | |
tree | b5a2c60194ba6dad248c89824b394764fd6c0c22 /drivers | |
parent | 168fc6c3c33ee7e9b2355e1a17d07e8313eb60f5 (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')
-rw-r--r-- | drivers/usb/serial/metro-usb.c | 20 |
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) | |||
135 | throttled = metro_priv->throttled; | 135 | throttled = metro_priv->throttled; |
136 | spin_unlock_irqrestore(&metro_priv->lock, flags); | 136 | spin_unlock_irqrestore(&metro_priv->lock, flags); |
137 | 137 | ||
138 | /* Continue trying to read if set. */ | 138 | if (throttled) |
139 | if (!throttled) { | 139 | return; |
140 | usb_fill_int_urb(port->interrupt_in_urb, port->serial->dev, | ||
141 | usb_rcvintpipe(port->serial->dev, port->interrupt_in_endpointAddress), | ||
142 | port->interrupt_in_urb->transfer_buffer, | ||
143 | port->interrupt_in_urb->transfer_buffer_length, | ||
144 | metrousb_read_int_callback, port, 1); | ||
145 | |||
146 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | ||
147 | |||
148 | if (result) | ||
149 | dev_err(&port->dev, | ||
150 | "%s - failed submitting interrupt in urb, error code=%d\n", | ||
151 | __func__, result); | ||
152 | } | ||
153 | return; | ||
154 | |||
155 | exit: | 140 | exit: |
156 | /* Try to resubmit the urb. */ | 141 | /* Try to resubmit the urb. */ |
157 | result = usb_submit_urb(urb, GFP_ATOMIC); | 142 | result = usb_submit_urb(urb, GFP_ATOMIC); |
@@ -337,7 +322,6 @@ static void metrousb_unthrottle(struct tty_struct *tty) | |||
337 | spin_unlock_irqrestore(&metro_priv->lock, flags); | 322 | spin_unlock_irqrestore(&metro_priv->lock, flags); |
338 | 323 | ||
339 | /* Submit the urb to read from the port. */ | 324 | /* Submit the urb to read from the port. */ |
340 | port->interrupt_in_urb->dev = port->serial->dev; | ||
341 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); | 325 | result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); |
342 | if (result) | 326 | if (result) |
343 | dev_err(tty->dev, | 327 | dev_err(tty->dev, |