]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
usb: core: urb make use of usb_endpoint_maxp_mult
authorMike Krinkin <krinkin.m.u@gmail.com>
Sun, 13 Nov 2016 10:31:16 +0000 (13:31 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Fri, 18 Nov 2016 11:54:41 +0000 (13:54 +0200)
Since usb_endpoint_maxp now returns only lower 11 bits mult
calculation here isn't correct anymore and that breaks webcam
for me. Patch make use of usb_endpoint_maxp_mult instead of
direct calculation.

Fixes: abb621844f6a ("usb: ch9: make usb_endpoint_maxp() return
       only packet size")

Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/core/urb.c

index a9039696476e68c8da475bbe40e1b841e64d903b..bd688a0661f9a82b3bd94b085059bc0285593832 100644 (file)
@@ -407,11 +407,8 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
                }
 
                /* "high bandwidth" mode, 1-3 packets/uframe? */
-               if (dev->speed == USB_SPEED_HIGH) {
-                       int     mult = 1 + ((max >> 11) & 0x03);
-                       max &= 0x07ff;
-                       max *= mult;
-               }
+               if (dev->speed == USB_SPEED_HIGH)
+                       max *= usb_endpoint_maxp_mult(&ep->desc);
 
                if (urb->number_of_packets <= 0)
                        return -EINVAL;