aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/omap_udc.c
diff options
context:
space:
mode:
authorIdo Shayevitz <idos@codeaurora.org>2012-03-12 14:25:35 -0400
committerFelipe Balbi <balbi@ti.com>2012-05-04 08:52:57 -0400
commitf8bdae061488f4120834beb632d74b4a5309753f (patch)
treed6e4b090de2feb10c498d7e5c98c92bb22255f43 /drivers/usb/gadget/omap_udc.c
parentb1371d161121108b9e58aeb1a16adc8a0b9b97c1 (diff)
usb: gadget: Update omap_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/omap_udc.c')
-rw-r--r--drivers/usb/gadget/omap_udc.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 3b4b6dd0f95a..7ba32469c5bd 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -153,7 +153,7 @@ static int omap_ep_enable(struct usb_ep *_ep,
153 u16 maxp; 153 u16 maxp;
154 154
155 /* catch various bogus parameters */ 155 /* catch various bogus parameters */
156 if (!_ep || !desc || ep->desc 156 if (!_ep || !desc || ep->ep.desc
157 || desc->bDescriptorType != USB_DT_ENDPOINT 157 || desc->bDescriptorType != USB_DT_ENDPOINT
158 || ep->bEndpointAddress != desc->bEndpointAddress 158 || ep->bEndpointAddress != desc->bEndpointAddress
159 || ep->maxpacket < usb_endpoint_maxp(desc)) { 159 || ep->maxpacket < usb_endpoint_maxp(desc)) {
@@ -200,7 +200,7 @@ static int omap_ep_enable(struct usb_ep *_ep,
200 200
201 spin_lock_irqsave(&udc->lock, flags); 201 spin_lock_irqsave(&udc->lock, flags);
202 202
203 ep->desc = desc; 203 ep->ep.desc = desc;
204 ep->irqs = 0; 204 ep->irqs = 0;
205 ep->stopped = 0; 205 ep->stopped = 0;
206 ep->ep.maxpacket = maxp; 206 ep->ep.maxpacket = maxp;
@@ -242,14 +242,13 @@ static int omap_ep_disable(struct usb_ep *_ep)
242 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep); 242 struct omap_ep *ep = container_of(_ep, struct omap_ep, ep);
243 unsigned long flags; 243 unsigned long flags;
244 244
245 if (!_ep || !ep->desc) { 245 if (!_ep || !ep->ep.desc) {
246 DBG("%s, %s not enabled\n", __func__, 246 DBG("%s, %s not enabled\n", __func__,
247 _ep ? ep->ep.name : NULL); 247 _ep ? ep->ep.name : NULL);
248 return -EINVAL; 248 return -EINVAL;
249 } 249 }
250 250
251 spin_lock_irqsave(&ep->udc->lock, flags); 251 spin_lock_irqsave(&ep->udc->lock, flags);
252 ep->desc = NULL;
253 ep->ep.desc = NULL; 252 ep->ep.desc = NULL;
254 nuke (ep, -ESHUTDOWN); 253 nuke (ep, -ESHUTDOWN);
255 ep->ep.maxpacket = ep->maxpacket; 254 ep->ep.maxpacket = ep->maxpacket;
@@ -917,7 +916,7 @@ omap_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
917 DBG("%s, bad params\n", __func__); 916 DBG("%s, bad params\n", __func__);
918 return -EINVAL; 917 return -EINVAL;
919 } 918 }
920 if (!_ep || (!ep->desc && ep->bEndpointAddress)) { 919 if (!_ep || (!ep->ep.desc && ep->bEndpointAddress)) {
921 DBG("%s, bad ep\n", __func__); 920 DBG("%s, bad ep\n", __func__);
922 return -EINVAL; 921 return -EINVAL;
923 } 922 }
@@ -1121,7 +1120,7 @@ static int omap_ep_set_halt(struct usb_ep *_ep, int value)
1121 status = 0; 1120 status = 0;
1122 1121
1123 /* otherwise, all active non-ISO endpoints can halt */ 1122 /* otherwise, all active non-ISO endpoints can halt */
1124 } else if (ep->bmAttributes != USB_ENDPOINT_XFER_ISOC && ep->desc) { 1123 } else if (ep->bmAttributes != USB_ENDPOINT_XFER_ISOC && ep->ep.desc) {
1125 1124
1126 /* IN endpoints must already be idle */ 1125 /* IN endpoints must already be idle */
1127 if ((ep->bEndpointAddress & USB_DIR_IN) 1126 if ((ep->bEndpointAddress & USB_DIR_IN)
@@ -1625,7 +1624,7 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
1625 if (w_index & USB_DIR_IN) 1624 if (w_index & USB_DIR_IN)
1626 ep += 16; 1625 ep += 16;
1627 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC 1626 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
1628 || !ep->desc) 1627 || !ep->ep.desc)
1629 goto do_stall; 1628 goto do_stall;
1630 use_ep(ep, 0); 1629 use_ep(ep, 0);
1631 omap_writew(udc->clr_halt, UDC_CTRL); 1630 omap_writew(udc->clr_halt, UDC_CTRL);
@@ -1653,7 +1652,7 @@ static void ep0_irq(struct omap_udc *udc, u16 irq_src)
1653 if (w_index & USB_DIR_IN) 1652 if (w_index & USB_DIR_IN)
1654 ep += 16; 1653 ep += 16;
1655 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC 1654 if (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
1656 || ep == ep0 || !ep->desc) 1655 || ep == ep0 || !ep->ep.desc)
1657 goto do_stall; 1656 goto do_stall;
1658 if (use_dma && ep->has_dma) { 1657 if (use_dma && ep->has_dma) {
1659 /* this has rude side-effects (aborts) and 1658 /* this has rude side-effects (aborts) and
@@ -1688,7 +1687,7 @@ ep0out_status_stage:
1688 ep = &udc->ep[w_index & 0xf]; 1687 ep = &udc->ep[w_index & 0xf];
1689 if (w_index & USB_DIR_IN) 1688 if (w_index & USB_DIR_IN)
1690 ep += 16; 1689 ep += 16;
1691 if (!ep->desc) 1690 if (!ep->ep.desc)
1692 goto do_stall; 1691 goto do_stall;
1693 1692
1694 /* iso never stalls */ 1693 /* iso never stalls */
@@ -2509,7 +2508,7 @@ static int proc_udc_show(struct seq_file *s, void *_)
2509 if (tmp & UDC_ADD) { 2508 if (tmp & UDC_ADD) {
2510 list_for_each_entry (ep, &udc->gadget.ep_list, 2509 list_for_each_entry (ep, &udc->gadget.ep_list,
2511 ep.ep_list) { 2510 ep.ep_list) {
2512 if (ep->desc) 2511 if (ep->ep.desc)
2513 proc_ep_show(s, ep); 2512 proc_ep_show(s, ep);
2514 } 2513 }
2515 } 2514 }