aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/pxa25x_udc.c
diff options
context:
space:
mode:
authorIdo Shayevitz <idos@codeaurora.org>2012-03-12 14:25:36 -0400
committerFelipe Balbi <balbi@ti.com>2012-05-04 08:52:58 -0400
commitc18800d8f9708c9e4a0b593d34f63af169b4b59a (patch)
tree1f2657c0f7951ef1049a2aed631c06f0417d5d39 /drivers/usb/gadget/pxa25x_udc.c
parentf8bdae061488f4120834beb632d74b4a5309753f (diff)
usb: gadget: Update pxa25x_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/pxa25x_udc.c')
-rw-r--r--drivers/usb/gadget/pxa25x_udc.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c
index 41ed69c96d8c..d7c8cb3bf759 100644
--- a/drivers/usb/gadget/pxa25x_udc.c
+++ b/drivers/usb/gadget/pxa25x_udc.c
@@ -218,7 +218,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep,
218 struct pxa25x_udc *dev; 218 struct pxa25x_udc *dev;
219 219
220 ep = container_of (_ep, struct pxa25x_ep, ep); 220 ep = container_of (_ep, struct pxa25x_ep, ep);
221 if (!_ep || !desc || ep->desc || _ep->name == ep0name 221 if (!_ep || !desc || ep->ep.desc || _ep->name == ep0name
222 || desc->bDescriptorType != USB_DT_ENDPOINT 222 || desc->bDescriptorType != USB_DT_ENDPOINT
223 || ep->bEndpointAddress != desc->bEndpointAddress 223 || ep->bEndpointAddress != desc->bEndpointAddress
224 || ep->fifo_size < usb_endpoint_maxp (desc)) { 224 || ep->fifo_size < usb_endpoint_maxp (desc)) {
@@ -249,7 +249,7 @@ static int pxa25x_ep_enable (struct usb_ep *_ep,
249 return -ESHUTDOWN; 249 return -ESHUTDOWN;
250 } 250 }
251 251
252 ep->desc = desc; 252 ep->ep.desc = desc;
253 ep->stopped = 0; 253 ep->stopped = 0;
254 ep->pio_irqs = 0; 254 ep->pio_irqs = 0;
255 ep->ep.maxpacket = usb_endpoint_maxp (desc); 255 ep->ep.maxpacket = usb_endpoint_maxp (desc);
@@ -269,7 +269,7 @@ static int pxa25x_ep_disable (struct usb_ep *_ep)
269 unsigned long flags; 269 unsigned long flags;
270 270
271 ep = container_of (_ep, struct pxa25x_ep, ep); 271 ep = container_of (_ep, struct pxa25x_ep, ep);
272 if (!_ep || !ep->desc) { 272 if (!_ep || !ep->ep.desc) {
273 DMSG("%s, %s not enabled\n", __func__, 273 DMSG("%s, %s not enabled\n", __func__,
274 _ep ? ep->ep.name : NULL); 274 _ep ? ep->ep.name : NULL);
275 return -EINVAL; 275 return -EINVAL;
@@ -281,7 +281,6 @@ static int pxa25x_ep_disable (struct usb_ep *_ep)
281 /* flush fifo (mostly for IN buffers) */ 281 /* flush fifo (mostly for IN buffers) */
282 pxa25x_ep_fifo_flush (_ep); 282 pxa25x_ep_fifo_flush (_ep);
283 283
284 ep->desc = NULL;
285 ep->ep.desc = NULL; 284 ep->ep.desc = NULL;
286 ep->stopped = 1; 285 ep->stopped = 1;
287 286
@@ -390,7 +389,7 @@ write_fifo (struct pxa25x_ep *ep, struct pxa25x_request *req)
390{ 389{
391 unsigned max; 390 unsigned max;
392 391
393 max = usb_endpoint_maxp(ep->desc); 392 max = usb_endpoint_maxp(ep->ep.desc);
394 do { 393 do {
395 unsigned count; 394 unsigned count;
396 int is_last, is_short; 395 int is_last, is_short;
@@ -644,7 +643,7 @@ pxa25x_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
644 } 643 }
645 644
646 ep = container_of(_ep, struct pxa25x_ep, ep); 645 ep = container_of(_ep, struct pxa25x_ep, ep);
647 if (unlikely (!_ep || (!ep->desc && ep->ep.name != ep0name))) { 646 if (unlikely(!_ep || (!ep->ep.desc && ep->ep.name != ep0name))) {
648 DMSG("%s, bad ep\n", __func__); 647 DMSG("%s, bad ep\n", __func__);
649 return -EINVAL; 648 return -EINVAL;
650 } 649 }
@@ -660,7 +659,7 @@ pxa25x_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
660 * we can report per-packet status. that also helps with dma. 659 * we can report per-packet status. that also helps with dma.
661 */ 660 */
662 if (unlikely (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC 661 if (unlikely (ep->bmAttributes == USB_ENDPOINT_XFER_ISOC
663 && req->req.length > usb_endpoint_maxp (ep->desc))) 662 && req->req.length > usb_endpoint_maxp(ep->ep.desc)))
664 return -EMSGSIZE; 663 return -EMSGSIZE;
665 664
666 DBG(DBG_NOISY, "%s queue req %p, len %d buf %p\n", 665 DBG(DBG_NOISY, "%s queue req %p, len %d buf %p\n",
@@ -673,7 +672,7 @@ pxa25x_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
673 672
674 /* kickstart this i/o queue? */ 673 /* kickstart this i/o queue? */
675 if (list_empty(&ep->queue) && !ep->stopped) { 674 if (list_empty(&ep->queue) && !ep->stopped) {
676 if (ep->desc == NULL/* ep0 */) { 675 if (ep->ep.desc == NULL/* ep0 */) {
677 unsigned length = _req->length; 676 unsigned length = _req->length;
678 677
679 switch (dev->ep0state) { 678 switch (dev->ep0state) {
@@ -722,7 +721,7 @@ pxa25x_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
722 req = NULL; 721 req = NULL;
723 } 722 }
724 723
725 if (likely (req && ep->desc)) 724 if (likely(req && ep->ep.desc))
726 pio_irq_enable(ep->bEndpointAddress); 725 pio_irq_enable(ep->bEndpointAddress);
727 } 726 }
728 727
@@ -749,7 +748,7 @@ static void nuke(struct pxa25x_ep *ep, int status)
749 queue); 748 queue);
750 done(ep, req, status); 749 done(ep, req, status);
751 } 750 }
752 if (ep->desc) 751 if (ep->ep.desc)
753 pio_irq_disable (ep->bEndpointAddress); 752 pio_irq_disable (ep->bEndpointAddress);
754} 753}
755 754
@@ -792,7 +791,7 @@ static int pxa25x_ep_set_halt(struct usb_ep *_ep, int value)
792 791
793 ep = container_of(_ep, struct pxa25x_ep, ep); 792 ep = container_of(_ep, struct pxa25x_ep, ep);
794 if (unlikely (!_ep 793 if (unlikely (!_ep
795 || (!ep->desc && ep->ep.name != ep0name)) 794 || (!ep->ep.desc && ep->ep.name != ep0name))
796 || ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) { 795 || ep->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
797 DMSG("%s, bad ep\n", __func__); 796 DMSG("%s, bad ep\n", __func__);
798 return -EINVAL; 797 return -EINVAL;
@@ -820,7 +819,7 @@ static int pxa25x_ep_set_halt(struct usb_ep *_ep, int value)
820 *ep->reg_udccs = UDCCS_BI_FST|UDCCS_BI_FTF; 819 *ep->reg_udccs = UDCCS_BI_FST|UDCCS_BI_FTF;
821 820
822 /* ep0 needs special care */ 821 /* ep0 needs special care */
823 if (!ep->desc) { 822 if (!ep->ep.desc) {
824 start_watchdog(ep->dev); 823 start_watchdog(ep->dev);
825 ep->dev->req_pending = 0; 824 ep->dev->req_pending = 0;
826 ep->dev->ep0state = EP0_STALL; 825 ep->dev->ep0state = EP0_STALL;
@@ -1087,7 +1086,7 @@ udc_seq_show(struct seq_file *m, void *_d)
1087 if (i != 0) { 1086 if (i != 0) {
1088 const struct usb_endpoint_descriptor *desc; 1087 const struct usb_endpoint_descriptor *desc;
1089 1088
1090 desc = ep->desc; 1089 desc = ep->ep.desc;
1091 if (!desc) 1090 if (!desc)
1092 continue; 1091 continue;
1093 tmp = *dev->ep [i].reg_udccs; 1092 tmp = *dev->ep [i].reg_udccs;
@@ -1191,7 +1190,6 @@ static void udc_reinit(struct pxa25x_udc *dev)
1191 if (i != 0) 1190 if (i != 0)
1192 list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list); 1191 list_add_tail (&ep->ep.ep_list, &dev->gadget.ep_list);
1193 1192
1194 ep->desc = NULL;
1195 ep->ep.desc = NULL; 1193 ep->ep.desc = NULL;
1196 ep->stopped = 0; 1194 ep->stopped = 0;
1197 INIT_LIST_HEAD (&ep->queue); 1195 INIT_LIST_HEAD (&ep->queue);