[RFC/PATCH 20/45] usb: gadget: udc: fsl: make use of new usb_endpoint_maxp_mult()

Felipe Balbi felipe.balbi at linux.intel.com
Wed Sep 28 23:05:29 AEST 2016


We have introduced a helper to calculate multiplier
value from wMaxPacketSize. Start using it.

Cc: Li Yang <leoli at freescale.com>
Cc: <linuxppc-dev at lists.ozlabs.org>
Signed-off-by: Felipe Balbi <felipe.balbi at linux.intel.com>
---
 drivers/usb/gadget/udc/fsl_udc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c
index aab5221d6c2e..4459644b9b55 100644
--- a/drivers/usb/gadget/udc/fsl_udc_core.c
+++ b/drivers/usb/gadget/udc/fsl_udc_core.c
@@ -585,7 +585,7 @@ static int fsl_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)
-- 
2.10.0.440.g21f862b



More information about the Linuxppc-dev mailing list