diff options
author | Ido Shayevitz <idos@codeaurora.org> | 2012-03-12 14:25:29 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:52:54 -0400 |
commit | 79149b8bd0270a268344300a77a2dd3f51039f14 (patch) | |
tree | 91405e09bc69678518f00c804a685dc7449b4c3f /drivers/usb/gadget | |
parent | ec39e2aeeff2901ef1b1d8ea09533e4b86ad89bb (diff) |
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/fsl_udc_core.c | 25 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_usb2_udc.h | 1 |
2 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c index 55abfb6bd612..8f6fc7046f8c 100644 --- a/drivers/usb/gadget/fsl_udc_core.c +++ b/drivers/usb/gadget/fsl_udc_core.c | |||
@@ -549,7 +549,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
549 | ep = container_of(_ep, struct fsl_ep, ep); | 549 | ep = container_of(_ep, struct fsl_ep, ep); |
550 | 550 | ||
551 | /* catch various bogus parameters */ | 551 | /* catch various bogus parameters */ |
552 | if (!_ep || !desc || ep->desc | 552 | if (!_ep || !desc || ep->ep.desc |
553 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) | 553 | || (desc->bDescriptorType != USB_DT_ENDPOINT)) |
554 | return -EINVAL; | 554 | return -EINVAL; |
555 | 555 | ||
@@ -590,7 +590,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
590 | 590 | ||
591 | spin_lock_irqsave(&udc->lock, flags); | 591 | spin_lock_irqsave(&udc->lock, flags); |
592 | ep->ep.maxpacket = max; | 592 | ep->ep.maxpacket = max; |
593 | ep->desc = desc; | 593 | ep->ep.desc = desc; |
594 | ep->stopped = 0; | 594 | ep->stopped = 0; |
595 | 595 | ||
596 | /* Controller related setup */ | 596 | /* Controller related setup */ |
@@ -614,7 +614,7 @@ static int fsl_ep_enable(struct usb_ep *_ep, | |||
614 | retval = 0; | 614 | retval = 0; |
615 | 615 | ||
616 | VDBG("enabled %s (ep%d%s) maxpacket %d",ep->ep.name, | 616 | VDBG("enabled %s (ep%d%s) maxpacket %d",ep->ep.name, |
617 | ep->desc->bEndpointAddress & 0x0f, | 617 | ep->ep.desc->bEndpointAddress & 0x0f, |
618 | (desc->bEndpointAddress & USB_DIR_IN) | 618 | (desc->bEndpointAddress & USB_DIR_IN) |
619 | ? "in" : "out", max); | 619 | ? "in" : "out", max); |
620 | en_done: | 620 | en_done: |
@@ -634,7 +634,7 @@ static int fsl_ep_disable(struct usb_ep *_ep) | |||
634 | int ep_num; | 634 | int ep_num; |
635 | 635 | ||
636 | ep = container_of(_ep, struct fsl_ep, ep); | 636 | ep = container_of(_ep, struct fsl_ep, ep); |
637 | if (!_ep || !ep->desc) { | 637 | if (!_ep || !ep->ep.desc) { |
638 | VDBG("%s not enabled", _ep ? ep->ep.name : NULL); | 638 | VDBG("%s not enabled", _ep ? ep->ep.name : NULL); |
639 | return -EINVAL; | 639 | return -EINVAL; |
640 | } | 640 | } |
@@ -657,7 +657,6 @@ static int fsl_ep_disable(struct usb_ep *_ep) | |||
657 | /* nuke all pending requests (does flush) */ | 657 | /* nuke all pending requests (does flush) */ |
658 | nuke(ep, -ESHUTDOWN); | 658 | nuke(ep, -ESHUTDOWN); |
659 | 659 | ||
660 | ep->desc = NULL; | ||
661 | ep->ep.desc = NULL; | 660 | ep->ep.desc = NULL; |
662 | ep->stopped = 1; | 661 | ep->stopped = 1; |
663 | spin_unlock_irqrestore(&udc->lock, flags); | 662 | 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) | |||
874 | VDBG("%s, bad params", __func__); | 873 | VDBG("%s, bad params", __func__); |
875 | return -EINVAL; | 874 | return -EINVAL; |
876 | } | 875 | } |
877 | if (unlikely(!_ep || !ep->desc)) { | 876 | if (unlikely(!_ep || !ep->ep.desc)) { |
878 | VDBG("%s, bad ep", __func__); | 877 | VDBG("%s, bad ep", __func__); |
879 | return -EINVAL; | 878 | return -EINVAL; |
880 | } | 879 | } |
881 | if (usb_endpoint_xfer_isoc(ep->desc)) { | 880 | if (usb_endpoint_xfer_isoc(ep->ep.desc)) { |
882 | if (req->req.length > ep->ep.maxpacket) | 881 | if (req->req.length > ep->ep.maxpacket) |
883 | return -EMSGSIZE; | 882 | return -EMSGSIZE; |
884 | } | 883 | } |
@@ -1017,12 +1016,12 @@ static int fsl_ep_set_halt(struct usb_ep *_ep, int value) | |||
1017 | 1016 | ||
1018 | ep = container_of(_ep, struct fsl_ep, ep); | 1017 | ep = container_of(_ep, struct fsl_ep, ep); |
1019 | udc = ep->udc; | 1018 | udc = ep->udc; |
1020 | if (!_ep || !ep->desc) { | 1019 | if (!_ep || !ep->ep.desc) { |
1021 | status = -EINVAL; | 1020 | status = -EINVAL; |
1022 | goto out; | 1021 | goto out; |
1023 | } | 1022 | } |
1024 | 1023 | ||
1025 | if (usb_endpoint_xfer_isoc(ep->desc)) { | 1024 | if (usb_endpoint_xfer_isoc(ep->ep.desc)) { |
1026 | status = -EOPNOTSUPP; | 1025 | status = -EOPNOTSUPP; |
1027 | goto out; | 1026 | goto out; |
1028 | } | 1027 | } |
@@ -1061,7 +1060,7 @@ static int fsl_ep_fifo_status(struct usb_ep *_ep) | |||
1061 | struct ep_queue_head *qh; | 1060 | struct ep_queue_head *qh; |
1062 | 1061 | ||
1063 | ep = container_of(_ep, struct fsl_ep, ep); | 1062 | ep = container_of(_ep, struct fsl_ep, ep); |
1064 | if (!_ep || (!ep->desc && ep_index(ep) != 0)) | 1063 | if (!_ep || (!ep->ep.desc && ep_index(ep) != 0)) |
1065 | return -ENODEV; | 1064 | return -ENODEV; |
1066 | 1065 | ||
1067 | udc = (struct fsl_udc *)ep->udc; | 1066 | udc = (struct fsl_udc *)ep->udc; |
@@ -1094,7 +1093,7 @@ static void fsl_ep_fifo_flush(struct usb_ep *_ep) | |||
1094 | return; | 1093 | return; |
1095 | } else { | 1094 | } else { |
1096 | ep = container_of(_ep, struct fsl_ep, ep); | 1095 | ep = container_of(_ep, struct fsl_ep, ep); |
1097 | if (!ep->desc) | 1096 | if (!ep->ep.desc) |
1098 | return; | 1097 | return; |
1099 | } | 1098 | } |
1100 | ep_num = ep_index(ep); | 1099 | ep_num = ep_index(ep); |
@@ -1349,7 +1348,7 @@ static void ch9getstatus(struct fsl_udc *udc, u8 request_type, u16 value, | |||
1349 | target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index)); | 1348 | target_ep = get_ep_by_pipe(udc, get_pipe_by_windex(index)); |
1350 | 1349 | ||
1351 | /* stall if endpoint doesn't exist */ | 1350 | /* stall if endpoint doesn't exist */ |
1352 | if (!target_ep->desc) | 1351 | if (!target_ep->ep.desc) |
1353 | goto stall; | 1352 | goto stall; |
1354 | tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep)) | 1353 | tmp = dr_ep_get_stall(ep_index(target_ep), ep_is_in(target_ep)) |
1355 | << USB_ENDPOINT_HALT; | 1354 | << USB_ENDPOINT_HALT; |
@@ -2259,7 +2258,7 @@ static int fsl_proc_read(char *page, char **start, off_t off, int count, | |||
2259 | } | 2258 | } |
2260 | /* other gadget->eplist ep */ | 2259 | /* other gadget->eplist ep */ |
2261 | list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { | 2260 | list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { |
2262 | if (ep->desc) { | 2261 | if (ep->ep.desc) { |
2263 | t = scnprintf(next, size, | 2262 | t = scnprintf(next, size, |
2264 | "\nFor %s Maxpkt is 0x%x " | 2263 | "\nFor %s Maxpkt is 0x%x " |
2265 | "index is 0x%x\n", | 2264 | "index is 0x%x\n", |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index e651469fd39b..d50222513731 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h | |||
@@ -450,7 +450,6 @@ struct fsl_ep { | |||
450 | struct list_head queue; | 450 | struct list_head queue; |
451 | struct fsl_udc *udc; | 451 | struct fsl_udc *udc; |
452 | struct ep_queue_head *qh; | 452 | struct ep_queue_head *qh; |
453 | const struct usb_endpoint_descriptor *desc; | ||
454 | struct usb_gadget *gadget; | 453 | struct usb_gadget *gadget; |
455 | 454 | ||
456 | char name[14]; | 455 | char name[14]; |