Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 303786
b: refs/heads/master
c: 79149b8
h: refs/heads/master
v: v3
  • Loading branch information
Ido Shayevitz authored and Felipe Balbi committed May 4, 2012
1 parent 3a77daa commit 8118378
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec39e2aeeff2901ef1b1d8ea09533e4b86ad89bb
refs/heads/master: 79149b8bd0270a268344300a77a2dd3f51039f14
25 changes: 12 additions & 13 deletions trunk/drivers/usb/gadget/fsl_udc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
ep = container_of(_ep, struct fsl_ep, ep);

/* catch various bogus parameters */
if (!_ep || !desc || ep->desc
if (!_ep || !desc || ep->ep.desc
|| (desc->bDescriptorType != USB_DT_ENDPOINT))
return -EINVAL;

Expand Down Expand Up @@ -590,7 +590,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,

spin_lock_irqsave(&udc->lock, flags);
ep->ep.maxpacket = max;
ep->desc = desc;
ep->ep.desc = desc;
ep->stopped = 0;

/* Controller related setup */
Expand All @@ -614,7 +614,7 @@ static int fsl_ep_enable(struct usb_ep *_ep,
retval = 0;

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)
? "in" : "out", max);
en_done:
Expand All @@ -634,7 +634,7 @@ static int fsl_ep_disable(struct usb_ep *_ep)
int ep_num;

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);
return -EINVAL;
}
Expand All @@ -657,7 +657,6 @@ static int fsl_ep_disable(struct usb_ep *_ep)
/* nuke all pending requests (does flush) */
nuke(ep, -ESHUTDOWN);

ep->desc = NULL;
ep->ep.desc = NULL;
ep->stopped = 1;
spin_unlock_irqrestore(&udc->lock, flags);
Expand Down Expand Up @@ -874,11 +873,11 @@ fsl_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
VDBG("%s, bad params", __func__);
return -EINVAL;
}
if (unlikely(!_ep || !ep->desc)) {
if (unlikely(!_ep || !ep->ep.desc)) {
VDBG("%s, bad ep", __func__);
return -EINVAL;
}
if (usb_endpoint_xfer_isoc(ep->desc)) {
if (usb_endpoint_xfer_isoc(ep->ep.desc)) {
if (req->req.length > ep->ep.maxpacket)
return -EMSGSIZE;
}
Expand Down Expand Up @@ -1017,12 +1016,12 @@ static int fsl_ep_set_halt(struct usb_ep *_ep, int value)

ep = container_of(_ep, struct fsl_ep, ep);
udc = ep->udc;
if (!_ep || !ep->desc) {
if (!_ep || !ep->ep.desc) {
status = -EINVAL;
goto out;
}

if (usb_endpoint_xfer_isoc(ep->desc)) {
if (usb_endpoint_xfer_isoc(ep->ep.desc)) {
status = -EOPNOTSUPP;
goto out;
}
Expand Down Expand Up @@ -1061,7 +1060,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep)
struct ep_queue_head *qh;

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;

udc = (struct fsl_udc *)ep->udc;
Expand Down Expand Up @@ -1094,7 +1093,7 @@ static void fsl_ep_fifo_flush(struct usb_ep *_ep)
return;
} else {
ep = container_of(_ep, struct fsl_ep, ep);
if (!ep->desc)
if (!ep->ep.desc)
return;
}
ep_num = ep_index(ep);
Expand Down Expand Up @@ -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));

/* stall if endpoint doesn't exist */
if (!target_ep->desc)
if (!target_ep->ep.desc)
goto stall;
tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep))
<< USB_ENDPOINT_HALT;
Expand Down Expand Up @@ -2259,7 +2258,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count,
}
/* other gadget->eplist ep */
list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) {
if (ep->desc) {
if (ep->ep.desc) {
t = scnprintf(next, size,
"\nFor %s Maxpkt is 0x%x "
"index is 0x%x\n",
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/usb/gadget/fsl_usb2_udc.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,6 @@ struct fsl_ep {
struct list_head queue;
struct fsl_udc *udc;
struct ep_queue_head *qh;
const struct usb_endpoint_descriptor *desc;
struct usb_gadget *gadget;

char name[14];
Expand Down

0 comments on commit 8118378

Please sign in to comment.