]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: gadget: udc: dummy: make use of new usb_endpoint_maxp_mult()
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Sep 2016 10:30:59 +0000 (13:30 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:18 +0000 (10:38 +0200)
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/dummy_hcd.c

index 77d07904f932e7d65bf735f5dc6238465a309650..14004cf88d4d6fc369ce59d656a957669fbfbf8c 100644 (file)
@@ -1483,8 +1483,7 @@ static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep)
                int     tmp;
 
                /* high bandwidth mode */
-               tmp = usb_endpoint_maxp(ep->desc);
-               tmp = (tmp >> 11) & 0x03;
+               tmp = usb_endpoint_maxp_mult(ep->desc);
                tmp *= 8 /* applies to entire frame */;
                limit += limit * tmp;
        }