aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Shayevitz <idos@codeaurora.org>2012-03-12 14:25:34 -0400
committerFelipe Balbi <balbi@ti.com>2012-05-04 08:52:57 -0400
commitb1371d161121108b9e58aeb1a16adc8a0b9b97c1 (patch)
tree265e17364557fd4a7d3d6cefd52daa6b0b5ef151
parent2eb2cff56aeb02e9451341b4d0fe7801e7fade14 (diff)
usb: gadget: Update mv_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>
-rw-r--r--drivers/usb/gadget/mv_udc.h1
-rw-r--r--drivers/usb/gadget/mv_udc_core.c19
2 files changed, 9 insertions, 11 deletions
diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h
index e2be9519abbe..9073436d8b24 100644
--- a/drivers/usb/gadget/mv_udc.h
+++ b/drivers/usb/gadget/mv_udc.h
@@ -232,7 +232,6 @@ struct mv_ep {
232 struct mv_udc *udc; 232 struct mv_udc *udc;
233 struct list_head queue; 233 struct list_head queue;
234 struct mv_dqh *dqh; 234 struct mv_dqh *dqh;
235 const struct usb_endpoint_descriptor *desc;
236 u32 direction; 235 u32 direction;
237 char name[14]; 236 char name[14];
238 unsigned stopped:1, 237 unsigned stopped:1,
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c
index a73cf406e2a4..dbcd1329495e 100644
--- a/drivers/usb/gadget/mv_udc_core.c
+++ b/drivers/usb/gadget/mv_udc_core.c
@@ -464,7 +464,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
464 ep = container_of(_ep, struct mv_ep, ep); 464 ep = container_of(_ep, struct mv_ep, ep);
465 udc = ep->udc; 465 udc = ep->udc;
466 466
467 if (!_ep || !desc || ep->desc 467 if (!_ep || !desc || ep->ep.desc
468 || desc->bDescriptorType != USB_DT_ENDPOINT) 468 || desc->bDescriptorType != USB_DT_ENDPOINT)
469 return -EINVAL; 469 return -EINVAL;
470 470
@@ -528,7 +528,7 @@ static int mv_ep_enable(struct usb_ep *_ep,
528 dqh->size_ioc_int_sts = 0; 528 dqh->size_ioc_int_sts = 0;
529 529
530 ep->ep.maxpacket = max; 530 ep->ep.maxpacket = max;
531 ep->desc = desc; 531 ep->ep.desc = desc;
532 ep->stopped = 0; 532 ep->stopped = 0;
533 533
534 /* Enable the endpoint for Rx or Tx and set the endpoint type */ 534 /* Enable the endpoint for Rx or Tx and set the endpoint type */
@@ -580,7 +580,7 @@ static int mv_ep_disable(struct usb_ep *_ep)
580 unsigned long flags; 580 unsigned long flags;
581 581
582 ep = container_of(_ep, struct mv_ep, ep); 582 ep = container_of(_ep, struct mv_ep, ep);
583 if ((_ep == NULL) || !ep->desc) 583 if ((_ep == NULL) || !ep->ep.desc)
584 return -EINVAL; 584 return -EINVAL;
585 585
586 udc = ep->udc; 586 udc = ep->udc;
@@ -606,7 +606,6 @@ static int mv_ep_disable(struct usb_ep *_ep)
606 /* nuke all pending requests (does flush) */ 606 /* nuke all pending requests (does flush) */
607 nuke(ep, -ESHUTDOWN); 607 nuke(ep, -ESHUTDOWN);
608 608
609 ep->desc = NULL;
610 ep->ep.desc = NULL; 609 ep->ep.desc = NULL;
611 ep->stopped = 1; 610 ep->stopped = 1;
612 611
@@ -651,7 +650,7 @@ static void mv_ep_fifo_flush(struct usb_ep *_ep)
651 return; 650 return;
652 651
653 ep = container_of(_ep, struct mv_ep, ep); 652 ep = container_of(_ep, struct mv_ep, ep);
654 if (!ep->desc) 653 if (!ep->ep.desc)
655 return; 654 return;
656 655
657 udc = ep->udc; 656 udc = ep->udc;
@@ -715,11 +714,11 @@ mv_ep_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags)
715 dev_err(&udc->dev->dev, "%s, bad params", __func__); 714 dev_err(&udc->dev->dev, "%s, bad params", __func__);
716 return -EINVAL; 715 return -EINVAL;
717 } 716 }
718 if (unlikely(!_ep || !ep->desc)) { 717 if (unlikely(!_ep || !ep->ep.desc)) {
719 dev_err(&udc->dev->dev, "%s, bad ep", __func__); 718 dev_err(&udc->dev->dev, "%s, bad ep", __func__);
720 return -EINVAL; 719 return -EINVAL;
721 } 720 }
722 if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) { 721 if (ep->ep.desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
723 if (req->req.length > ep->ep.maxpacket) 722 if (req->req.length > ep->ep.maxpacket)
724 return -EMSGSIZE; 723 return -EMSGSIZE;
725 } 724 }
@@ -925,12 +924,12 @@ static int mv_ep_set_halt_wedge(struct usb_ep *_ep, int halt, int wedge)
925 924
926 ep = container_of(_ep, struct mv_ep, ep); 925 ep = container_of(_ep, struct mv_ep, ep);
927 udc = ep->udc; 926 udc = ep->udc;
928 if (!_ep || !ep->desc) { 927 if (!_ep || !ep->ep.desc) {
929 status = -EINVAL; 928 status = -EINVAL;
930 goto out; 929 goto out;
931 } 930 }
932 931
933 if (ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) { 932 if (ep->ep.desc->bmAttributes == USB_ENDPOINT_XFER_ISOC) {
934 status = -EOPNOTSUPP; 933 status = -EOPNOTSUPP;
935 goto out; 934 goto out;
936 } 935 }
@@ -1279,7 +1278,7 @@ static int eps_init(struct mv_udc *udc)
1279 ep->stopped = 0; 1278 ep->stopped = 0;
1280 ep->ep.maxpacket = EP0_MAX_PKT_SIZE; 1279 ep->ep.maxpacket = EP0_MAX_PKT_SIZE;
1281 ep->ep_num = 0; 1280 ep->ep_num = 0;
1282 ep->desc = &mv_ep0_desc; 1281 ep->ep.desc = &mv_ep0_desc;
1283 INIT_LIST_HEAD(&ep->queue); 1282 INIT_LIST_HEAD(&ep->queue);
1284 1283
1285 ep->ep_type = USB_ENDPOINT_XFER_CONTROL; 1284 ep->ep_type = USB_ENDPOINT_XFER_CONTROL;