Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -18
+2 -18
drivers/usb/serial/metro-usb.c
··· 135 135 throttled = metro_priv->throttled; 136 136 spin_unlock_irqrestore(&metro_priv->lock, flags); 137 137 138 - /* Continue trying to read if set. */ 139 - if (!throttled) { 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 - 138 + if (throttled) 139 + return; 155 140 exit: 156 141 /* Try to resubmit the urb. */ 157 142 result = usb_submit_urb(urb, GFP_ATOMIC); ··· 322 337 spin_unlock_irqrestore(&metro_priv->lock, flags); 323 338 324 339 /* Submit the urb to read from the port. */ 325 - port->interrupt_in_urb->dev = port->serial->dev; 326 340 result = usb_submit_urb(port->interrupt_in_urb, GFP_ATOMIC); 327 341 if (result) 328 342 dev_err(tty->dev,