diff options
author | Ido Shayevitz <idos@codeaurora.org> | 2012-03-12 14:25:27 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:52:53 -0400 |
commit | 978def1c4e796eebca6047b8de164c7d182494e3 (patch) | |
tree | 4edee5081cbe8beb3c45d2d8d90bfad6d4288334 /drivers/usb/gadget/atmel_usba_udc.c | |
parent | 5a6506f00efa4b38b181152b69a072e766c7ce92 (diff) |
usb: gadget: Update atmel_usba_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>
Diffstat (limited to 'drivers/usb/gadget/atmel_usba_udc.c')
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 9f98508966d1..f545e933758f 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -599,13 +599,13 @@ usba_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
599 | 599 | ||
600 | spin_lock_irqsave(&ep->udc->lock, flags); | 600 | spin_lock_irqsave(&ep->udc->lock, flags); |
601 | 601 | ||
602 | if (ep->desc) { | 602 | if (ep->ep.desc) { |
603 | spin_unlock_irqrestore(&ep->udc->lock, flags); | 603 | spin_unlock_irqrestore(&ep->udc->lock, flags); |
604 | DBG(DBG_ERR, "ep%d already enabled\n", ep->index); | 604 | DBG(DBG_ERR, "ep%d already enabled\n", ep->index); |
605 | return -EBUSY; | 605 | return -EBUSY; |
606 | } | 606 | } |
607 | 607 | ||
608 | ep->desc = desc; | 608 | ep->ep.desc = desc; |
609 | ep->ep.maxpacket = maxpacket; | 609 | ep->ep.maxpacket = maxpacket; |
610 | 610 | ||
611 | usba_ep_writel(ep, CFG, ept_cfg); | 611 | usba_ep_writel(ep, CFG, ept_cfg); |
@@ -647,7 +647,7 @@ static int usba_ep_disable(struct usb_ep *_ep) | |||
647 | 647 | ||
648 | spin_lock_irqsave(&udc->lock, flags); | 648 | spin_lock_irqsave(&udc->lock, flags); |
649 | 649 | ||
650 | if (!ep->desc) { | 650 | if (!ep->ep.desc) { |
651 | spin_unlock_irqrestore(&udc->lock, flags); | 651 | spin_unlock_irqrestore(&udc->lock, flags); |
652 | /* REVISIT because this driver disables endpoints in | 652 | /* REVISIT because this driver disables endpoints in |
653 | * reset_all_endpoints() before calling disconnect(), | 653 | * reset_all_endpoints() before calling disconnect(), |
@@ -658,7 +658,6 @@ static int usba_ep_disable(struct usb_ep *_ep) | |||
658 | ep->ep.name); | 658 | ep->ep.name); |
659 | return -EINVAL; | 659 | return -EINVAL; |
660 | } | 660 | } |
661 | ep->desc = NULL; | ||
662 | ep->ep.desc = NULL; | 661 | ep->ep.desc = NULL; |
663 | 662 | ||
664 | list_splice_init(&ep->queue, &req_list); | 663 | list_splice_init(&ep->queue, &req_list); |
@@ -752,7 +751,7 @@ static int queue_dma(struct usba_udc *udc, struct usba_ep *ep, | |||
752 | */ | 751 | */ |
753 | ret = -ESHUTDOWN; | 752 | ret = -ESHUTDOWN; |
754 | spin_lock_irqsave(&udc->lock, flags); | 753 | spin_lock_irqsave(&udc->lock, flags); |
755 | if (ep->desc) { | 754 | if (ep->ep.desc) { |
756 | if (list_empty(&ep->queue)) | 755 | if (list_empty(&ep->queue)) |
757 | submit_request(ep, req); | 756 | submit_request(ep, req); |
758 | 757 | ||
@@ -776,7 +775,8 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) | |||
776 | DBG(DBG_GADGET | DBG_QUEUE | DBG_REQ, "%s: queue req %p, len %u\n", | 775 | DBG(DBG_GADGET | DBG_QUEUE | DBG_REQ, "%s: queue req %p, len %u\n", |
777 | ep->ep.name, req, _req->length); | 776 | ep->ep.name, req, _req->length); |
778 | 777 | ||
779 | if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN || !ep->desc) | 778 | if (!udc->driver || udc->gadget.speed == USB_SPEED_UNKNOWN || |
779 | !ep->ep.desc) | ||
780 | return -ESHUTDOWN; | 780 | return -ESHUTDOWN; |
781 | 781 | ||
782 | req->submitted = 0; | 782 | req->submitted = 0; |
@@ -792,7 +792,7 @@ usba_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) | |||
792 | /* May have received a reset since last time we checked */ | 792 | /* May have received a reset since last time we checked */ |
793 | ret = -ESHUTDOWN; | 793 | ret = -ESHUTDOWN; |
794 | spin_lock_irqsave(&udc->lock, flags); | 794 | spin_lock_irqsave(&udc->lock, flags); |
795 | if (ep->desc) { | 795 | if (ep->ep.desc) { |
796 | list_add_tail(&req->queue, &ep->queue); | 796 | list_add_tail(&req->queue, &ep->queue); |
797 | 797 | ||
798 | if ((!ep_is_control(ep) && ep->is_in) || | 798 | if ((!ep_is_control(ep) && ep->is_in) || |
@@ -905,7 +905,7 @@ static int usba_ep_set_halt(struct usb_ep *_ep, int value) | |||
905 | DBG(DBG_GADGET, "endpoint %s: %s HALT\n", ep->ep.name, | 905 | DBG(DBG_GADGET, "endpoint %s: %s HALT\n", ep->ep.name, |
906 | value ? "set" : "clear"); | 906 | value ? "set" : "clear"); |
907 | 907 | ||
908 | if (!ep->desc) { | 908 | if (!ep->ep.desc) { |
909 | DBG(DBG_ERR, "Attempted to halt uninitialized ep %s\n", | 909 | DBG(DBG_ERR, "Attempted to halt uninitialized ep %s\n", |
910 | ep->ep.name); | 910 | ep->ep.name); |
911 | return -ENODEV; | 911 | return -ENODEV; |
@@ -1071,7 +1071,7 @@ static void reset_all_endpoints(struct usba_udc *udc) | |||
1071 | * FIXME remove this code ... and retest thoroughly. | 1071 | * FIXME remove this code ... and retest thoroughly. |
1072 | */ | 1072 | */ |
1073 | list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { | 1073 | list_for_each_entry(ep, &udc->gadget.ep_list, ep.ep_list) { |
1074 | if (ep->desc) { | 1074 | if (ep->ep.desc) { |
1075 | spin_unlock(&udc->lock); | 1075 | spin_unlock(&udc->lock); |
1076 | usba_ep_disable(&ep->ep); | 1076 | usba_ep_disable(&ep->ep); |
1077 | spin_lock(&udc->lock); | 1077 | spin_lock(&udc->lock); |
@@ -1089,9 +1089,9 @@ static struct usba_ep *get_ep_by_addr(struct usba_udc *udc, u16 wIndex) | |||
1089 | list_for_each_entry (ep, &udc->gadget.ep_list, ep.ep_list) { | 1089 | list_for_each_entry (ep, &udc->gadget.ep_list, ep.ep_list) { |
1090 | u8 bEndpointAddress; | 1090 | u8 bEndpointAddress; |
1091 | 1091 | ||
1092 | if (!ep->desc) | 1092 | if (!ep->ep.desc) |
1093 | continue; | 1093 | continue; |
1094 | bEndpointAddress = ep->desc->bEndpointAddress; | 1094 | bEndpointAddress = ep->ep.desc->bEndpointAddress; |
1095 | if ((wIndex ^ bEndpointAddress) & USB_DIR_IN) | 1095 | if ((wIndex ^ bEndpointAddress) & USB_DIR_IN) |
1096 | continue; | 1096 | continue; |
1097 | if ((bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) | 1097 | if ((bEndpointAddress & USB_ENDPOINT_NUMBER_MASK) |
@@ -1727,7 +1727,7 @@ static irqreturn_t usba_udc_irq(int irq, void *devid) | |||
1727 | usb_speed_string(udc->gadget.speed)); | 1727 | usb_speed_string(udc->gadget.speed)); |
1728 | 1728 | ||
1729 | ep0 = &usba_ep[0]; | 1729 | ep0 = &usba_ep[0]; |
1730 | ep0->desc = &usba_ep0_desc; | 1730 | ep0->ep.desc = &usba_ep0_desc; |
1731 | ep0->state = WAIT_FOR_SETUP; | 1731 | ep0->state = WAIT_FOR_SETUP; |
1732 | usba_ep_writel(ep0, CFG, | 1732 | usba_ep_writel(ep0, CFG, |
1733 | (USBA_BF(EPT_SIZE, EP0_EPT_SIZE) | 1733 | (USBA_BF(EPT_SIZE, EP0_EPT_SIZE) |