Hi, Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx> writes: > On 10/31/2016 1:48 PM, Felipe Balbi wrote: > >> We have introduced a helper to calculate multiplier >> value from wMaxPacketSize. Start using it. >> >> Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> >> --- >> drivers/usb/gadget/udc/gr_udc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c >> index 39b7136d31d9..3786b5dbfd01 100644 >> --- a/drivers/usb/gadget/udc/gr_udc.c >> +++ b/drivers/usb/gadget/udc/gr_udc.c >> @@ -1539,7 +1539,7 @@ static int gr_ep_enable(struct usb_ep *_ep, >> * additional transactions. >> */ >> max = 0x7ff & usb_endpoint_maxp(desc); >> - nt = 0x3 & (usb_endpoint_maxp(desc) >> 11); >> + nt = usb_endpoint_maxp_mult(desc); > > Don't you need '- 1' here? Good catch, here's v2: 8<------------------------------------------------------------------------------ From d20794e89a0f290edc9c522c5e75177a30d45d41 Mon Sep 17 00:00:00 2001 From: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> Date: Wed, 28 Sep 2016 13:36:58 +0300 Subject: [PATCH v2] usb: gadget: udc: gr: make use of new usb_endpoint_maxp_mult() We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Signed-off-by: Felipe Balbi <felipe.balbi@xxxxxxxxxxxxxxx> --- drivers/usb/gadget/udc/gr_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/gadget/udc/gr_udc.c b/drivers/usb/gadget/udc/gr_udc.c index 39b7136d31d9..b16f8af34050 100644 --- a/drivers/usb/gadget/udc/gr_udc.c +++ b/drivers/usb/gadget/udc/gr_udc.c @@ -1539,7 +1539,7 @@ static int gr_ep_enable(struct usb_ep *_ep, * additional transactions. */ max = 0x7ff & usb_endpoint_maxp(desc); - nt = 0x3 & (usb_endpoint_maxp(desc) >> 11); + nt = usb_endpoint_maxp_mult(desc) - 1; buffer_size = GR_BUFFER_SIZE(epctrl); if (nt && (mode == 0 || mode == 2)) { dev_err(dev->dev, -- 2.10.1 -- balbi
Attachment:
signature.asc
Description: PGP signature