usb: gadget: Update fsl_udc_core 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
ec39e2aeef
commit
79149b8bd0
@ -549,7 +549,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
|
|||||||
ep = container_of(_ep, struct fsl_ep, ep);
|
ep = container_of(_ep, struct fsl_ep, ep);
|
||||||
|
|
||||||
/* catch various bogus parameters */
|
/* catch various bogus parameters */
|
||||||
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;
|
||||||
|
|
||||||
@ -590,7 +590,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
|
|||||||
|
|
||||||
spin_lock_irqsave(&udc->lock, flags);
|
spin_lock_irqsave(&udc->lock, flags);
|
||||||
ep->ep.maxpacket = max;
|
ep->ep.maxpacket = max;
|
||||||
ep->desc = desc;
|
ep->ep.desc = desc;
|
||||||
ep->stopped = 0;
|
ep->stopped = 0;
|
||||||
|
|
||||||
/* Controller related setup */
|
/* Controller related setup */
|
||||||
@ -614,7 +614,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
|
|||||||
retval = 0;
|
retval = 0;
|
||||||
|
|
||||||
VDBG("enabled %s (ep%d%s) maxpacket %d",ep->ep.name,
|
VDBG("enabled %s (ep%d%s) maxpacket %d",ep->ep.name,
|
||||||
ep->desc->bEndpointAddress & 0x0f,
|
ep->ep.desc->bEndpointAddress & 0x0f,
|
||||||
(desc->bEndpointAddress & USB_DIR_IN)
|
(desc->bEndpointAddress & USB_DIR_IN)
|
||||||
? "in" : "out", max);
|
? "in" : "out", max);
|
||||||
en_done:
|
en_done:
|
||||||
@ -634,7 +634,7 @@ static int fsl_ep_disable(struct usb_ep *_ep)
|
|||||||
int ep_num;
|
int ep_num;
|
||||||
|
|
||||||
ep = container_of(_ep, struct fsl_ep, ep);
|
ep = container_of(_ep, struct fsl_ep, ep);
|
||||||
if (!_ep || !ep->desc) {
|
if (!_ep || !ep->ep.desc) {
|
||||||
VDBG("%s not enabled", _ep ? ep->ep.name : NULL);
|
VDBG("%s not enabled", _ep ? ep->ep.name : NULL);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -657,7 +657,6 @@ static int fsl_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;
|
||||||
spin_unlock_irqrestore(&udc->lock, flags);
|
spin_unlock_irqrestore(&udc->lock, flags);
|
||||||
@ -874,11 +873,11 @@ fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
|
|||||||
VDBG("%s, bad params", __func__);
|
VDBG("%s, bad params", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (unlikely(!_ep || !ep->desc)) {
|
if (unlikely(!_ep || !ep->ep.desc)) {
|
||||||
VDBG("%s, bad ep", __func__);
|
VDBG("%s, bad ep", __func__);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
if (usb_endpoint_xfer_isoc(ep->desc)) {
|
if (usb_endpoint_xfer_isoc(ep->ep.desc)) {
|
||||||
if (req->req.length > ep->ep.maxpacket)
|
if (req->req.length > ep->ep.maxpacket)
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
}
|
}
|
||||||
@ -1017,12 +1016,12 @@ static int fsl_ep_set_halt(struct usb_ep *_ep, int value)
|
|||||||
|
|
||||||
ep = container_of(_ep, struct fsl_ep, ep);
|
ep = container_of(_ep, struct fsl_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 (usb_endpoint_xfer_isoc(ep->desc)) {
|
if (usb_endpoint_xfer_isoc(ep->ep.desc)) {
|
||||||
status = -EOPNOTSUPP;
|
status = -EOPNOTSUPP;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -1061,7 +1060,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
|
|||||||
struct ep_queue_head *qh;
|
struct ep_queue_head *qh;
|
||||||
|
|
||||||
ep = container_of(_ep, struct fsl_ep, ep);
|
ep = container_of(_ep, struct fsl_ep, ep);
|
||||||
if (!_ep || (!ep->desc && ep_index(ep) != 0))
|
if (!_ep || (!ep->ep.desc && ep_index(ep) != 0))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
udc = (struct fsl_udc *)ep->udc;
|
udc = (struct fsl_udc *)ep->udc;
|
||||||
@ -1094,7 +1093,7 @@ static void fsl_ep_fifo_flush(struct usb_ep *_ep)
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
ep = container_of(_ep, struct fsl_ep, ep);
|
ep = container_of(_ep, struct fsl_ep, ep);
|
||||||
if (!ep->desc)
|
if (!ep->ep.desc)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ep_num = ep_index(ep);
|
ep_num = ep_index(ep);
|
||||||
@ -1349,7 +1348,7 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value,
|
|||||||
target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index));
|
target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index));
|
||||||
|
|
||||||
/* stall if endpoint doesn't exist */
|
/* stall if endpoint doesn't exist */
|
||||||
if (!target_ep->desc)
|
if (!target_ep->ep.desc)
|
||||||
goto stall;
|
goto stall;
|
||||||
tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep))
|
tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep))
|
||||||
<< USB_ENDPOINT_HALT;
|
<< USB_ENDPOINT_HALT;
|
||||||
@ -2259,7 +2258,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
|
|||||||
}
|
}
|
||||||
/* other gadget->eplist ep */
|
/* other gadget->eplist ep */
|
||||||
list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
|
list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
|
||||||
if (ep->desc) {
|
if (ep->ep.desc) {
|
||||||
t = scnprintf(next, size,
|
t = scnprintf(next, size,
|
||||||
"\nFor %s Maxpkt is 0x%x "
|
"\nFor %s Maxpkt is 0x%x "
|
||||||
"index is 0x%x\n",
|
"index is 0x%x\n",
|
||||||
|
@ -450,7 +450,6 @@ struct fsl_ep {
|
|||||||
struct list_head queue;
|
struct list_head queue;
|
||||||
struct fsl_udc *udc;
|
struct fsl_udc *udc;
|
||||||
struct ep_queue_head *qh;
|
struct ep_queue_head *qh;
|
||||||
const struct usb_endpoint_descriptor *desc;
|
|
||||||
struct usb_gadget *gadget;
|
struct usb_gadget *gadget;
|
||||||
|
|
||||||
char name[14];
|
char name[14];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user