usb: gadget: udc: atmel: make use of new usb_endpoint_maxp_mult()
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 28 Sep 2016 10:28:44 +0000 (13:28 +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.

Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/udc/atmel_usba_udc.c

index 45bc997..c57012b 100644 (file)
@@ -573,7 +573,7 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc)
                 * Bits 11:12 specify number of _additional_
                 * transactions per microframe.
                 */
-               nr_trans = ((usb_endpoint_maxp(desc) >> 11) & 3) + 1;
+               nr_trans = usb_endpoint_maxp_mult(desc);
                if (nr_trans > 3)
                        return -EINVAL;