usb: gadget: udc: mv_udc: make use of new usb_endpoint_maxp_mult()
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Sep 2016 10:37:46 +0000 (13:37 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 3 Nov 2016 08:38:20 +0000 (10:38 +0200)
We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/mv_udc_core.c

index ce73b3552269fcd3793102d408685f69701ed22e..542b70a83ee6c01e10c4f8febb0e3fa09d5ce61d 100644 (file)
@@ -494,7 +494,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
                break;
        case USB_ENDPOINT_XFER_ISOC:
                /* Calculate transactions needed for high bandwidth iso */
-               mult = (unsigned char)(1 + ((max >> 11) & 0x03));
+               mult = usb_endpoint_maxp_mult(desc);
                max = max & 0x7ff;      /* bit 0~10 */
                /* 3 transactions at most */
                if (mult > 3)