usb: gadget: Update mv_udc to use usb_endpoint_descriptor inside the struct usb_ep
Remove redundant pointer to struct usb_endpoint_descriptor. Signed-off-by: Ido Shayevitz <idos@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
This commit is contained in:
parent
2eb2cff56a
commit
b1371d1611
|
@ -232,7 +232,6 @@ struct mv_ep {
|
||||||
struct mv_udc *udc;
|
struct mv_udc *udc;
|
||||||
struct list_head queue;
|
struct list_head queue;
|
||||||
struct mv_dqh *dqh;
|
struct mv_dqh *dqh;
|
||||||
const struct usb_endpoint_descriptor *desc;
|
|
||||||
u32 direction;
|
u32 direction;
|
||||||
char name[14];
|
char name[14];
|
||||||
unsigned stopped:1,
|
unsigned stopped:1,
|
||||||
|
|
|
@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
|
||||||
ep = container_of(_ep, struct mv_ep, ep);
|
ep = container_of(_ep, struct mv_ep, ep);
|
||||||
udc = ep->udc;
|
udc = ep->udc;
|
||||||
|
|
||||||
if (!_ep || !desc || ep->desc
|
if (!_ep || !desc || ep->ep.desc
|
||||||
|| desc->bDescriptorType != USB_DT_ENDPOINT)
|
|| desc->bDescriptorType != USB_DT_ENDPOINT)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
@ -528,7 +528,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
|
||||||
dqh->size_ioc_int_sts = 0;
|
dqh->size_ioc_int_sts = 0;
|
||||||
|
|
||||||
ep->ep.maxpacket = max;
|
ep->ep.maxpacket = max;
|
||||||
ep->desc = desc;
|
ep->ep.desc = desc;
|
||||||
ep->stopped = 0;
|
ep->stopped = 0;
|
||||||
|
|
||||||
/* Enable the endpoint for Rx or Tx and set the endpoint type */
|
/* Enable the endpoint for Rx or Tx and set the endpoint type */
|
||||||
|
@ -580,7 +580,7 @@ static int mv_ep_disable(struct usb_ep *_ep)
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
ep = container_of(_ep, struct mv_ep, ep);
|
ep = container_of(_ep, struct mv_ep, ep);
|
||||||
if ((_ep == NULL) || !ep->desc)
|
if ((_ep == NULL) || !ep->ep.desc)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
udc = ep->udc;
|
udc = ep->udc;
|
||||||
|
@ -606,7 +606,6 @@ static int mv_ep_disable(struct usb_ep *_ep)
|
||||||
/* nuke all pending requests (does flush) */
|
/* nuke all pending requests (does flush) */
|
||||||
nuke(ep, -ESHUTDOWN);
|
nuke(ep, -ESHUTDOWN);
|
||||||
|
|
||||||
ep->desc = NULL;
|
|
||||||
ep->ep.desc = NULL;
|
ep->ep.desc = NULL;
|
||||||
ep->stopped = 1;
|
ep->stopped = 1;
|
||||||
|
|
||||||
|
@ -651,7 +650,7 @@ static void mv_ep_fifo_flush(struct usb_ep *_ep)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ep = container_of(_ep, struct mv_ep, ep);
|
ep = container_of(_ep, struct mv_ep, ep);
|
||||||
if (!ep->desc)
|
if (!ep->ep.desc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
udc = ep->udc;
|
udc = ep->udc;
|
||||||
|
@ -715,11 +714,11 @@ mv_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
|
||||||
dev_err(&udc->dev->dev, "%s, bad params", __func__);
|
dev_err(&udc->dev->dev, "%s, bad params", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (unlikely(!_ep || !ep->desc)) {
|
if (unlikely(!_ep || !ep->ep.desc)) {
|
||||||
dev_err(&udc->dev->dev, "%s, bad ep", __func__);
|
dev_err(&udc->dev->dev, "%s, bad ep", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
|
if (ep->ep.desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
|
||||||
if (req->req.length > ep->ep.maxpacket)
|
if (req->req.length > ep->ep.maxpacket)
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
}
|
}
|
||||||
|
@ -925,12 +924,12 @@ static int mv_ep_set_halt_wedge(struct usb_ep *_ep, int halt, int wedge)
|
||||||
|
|
||||||
ep = container_of(_ep, struct mv_ep, ep);
|
ep = container_of(_ep, struct mv_ep, ep);
|
||||||
udc = ep->udc;
|
udc = ep->udc;
|
||||||
if (!_ep || !ep->desc) {
|
if (!_ep || !ep->ep.desc) {
|
||||||
status = -EINVAL;
|
status = -EINVAL;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
|
if (ep->ep.desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
|
||||||
status = -EOPNOTSUPP;
|
status = -EOPNOTSUPP;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -1279,7 +1278,7 @@ static int eps_init(struct mv_udc *udc)
|
||||||
ep->stopped = 0;
|
ep->stopped = 0;
|
||||||
ep->ep.maxpacket = EP0_MAX_PKT_SIZE;
|
ep->ep.maxpacket = EP0_MAX_PKT_SIZE;
|
||||||
ep->ep_num = 0;
|
ep->ep_num = 0;
|
||||||
ep->desc = &mv_ep0_desc;
|
ep->ep.desc = &mv_ep0_desc;
|
||||||
INIT_LIST_HEAD(&ep->queue);
|
INIT_LIST_HEAD(&ep->queue);
|
||||||
|
|
||||||
ep->ep_type = USB_ENDPOINT_XFER_CONTROL;
|
ep->ep_type = USB_ENDPOINT_XFER_CONTROL;
|
||||||
|
|
Loading…
Reference in a new issue