usb: chipidea: udc: make use of new usb_endpoint_maxp_mult()
We have introduced a helper to calculate multiplier value from wMaxPacketSize. Start using it. Acked-by: Peter Chen <Peter.Chen@nxp.com> Cc: <linux-usb@vger.kernel.org> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
parent
08295ee0e6
commit
a98e25e71d
1 changed files with 2 additions and 2 deletions
|
@ -821,7 +821,7 @@ static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usb_endpoint_xfer_isoc(hwep->ep.desc) &&
|
if (usb_endpoint_xfer_isoc(hwep->ep.desc) &&
|
||||||
hwreq->req.length > (1 + hwep->ep.mult) * hwep->ep.maxpacket) {
|
hwreq->req.length > hwep->ep.mult * hwep->ep.maxpacket) {
|
||||||
dev_err(hwep->ci->dev, "request length too big for isochronous\n");
|
dev_err(hwep->ci->dev, "request length too big for isochronous\n");
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
}
|
}
|
||||||
|
@ -1254,7 +1254,7 @@ static int ep_enable(struct usb_ep *ep,
|
||||||
hwep->type = usb_endpoint_type(desc);
|
hwep->type = usb_endpoint_type(desc);
|
||||||
|
|
||||||
hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff;
|
hwep->ep.maxpacket = usb_endpoint_maxp(desc) & 0x07ff;
|
||||||
hwep->ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc));
|
hwep->ep.mult = usb_endpoint_maxp_mult(desc);
|
||||||
|
|
||||||
if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
|
if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
|
||||||
cap |= QH_IOS;
|
cap |= QH_IOS;
|
||||||
|
|
Loading…
Reference in a new issue