diff options
author | Ido Shayevitz <idos@codeaurora.org> | 2012-03-12 14:25:31 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:52:55 -0400 |
commit | db79d9811b077fc9c215d33a57bbb11cecc59fe3 (patch) | |
tree | 5f2667e50c190457928b7ba8fdd8513b2a9b6131 /drivers/usb/gadget/goku_udc.c | |
parent | fab1137f63c417da02406a3a97c77790e6d06e6f (diff) |
usb: gadget: Update goku_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/goku_udc.c')
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c index 6ae874ea5b5b..b241e6c6a7f2 100644 --- a/drivers/usb/gadget/goku_udc.c +++ b/drivers/usb/gadget/goku_udc.c | |||
@@ -102,7 +102,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
102 | unsigned long flags; | 102 | unsigned long flags; |
103 | 103 | ||
104 | ep = container_of(_ep, struct goku_ep, ep); | 104 | ep = container_of(_ep, struct goku_ep, ep); |
105 | if (!_ep || !desc || ep->desc | 105 | if (!_ep || !desc || ep->ep.desc |
106 | || desc->bDescriptorType != USB_DT_ENDPOINT) | 106 | || desc->bDescriptorType != USB_DT_ENDPOINT) |
107 | return -EINVAL; | 107 | return -EINVAL; |
108 | dev = ep->dev; | 108 | dev = ep->dev; |
@@ -176,7 +176,7 @@ goku_ep_enable(struct usb_ep *_ep, const struct usb_endpoint_descriptor *desc) | |||
176 | command(ep->dev->regs, COMMAND_RESET, ep->num); | 176 | command(ep->dev->regs, COMMAND_RESET, ep->num); |
177 | ep->ep.maxpacket = max; | 177 | ep->ep.maxpacket = max; |
178 | ep->stopped = 0; | 178 | ep->stopped = 0; |
179 | ep->desc = desc; | 179 | ep->ep.desc = desc; |
180 | spin_unlock_irqrestore(&ep->dev->lock, flags); | 180 | spin_unlock_irqrestore(&ep->dev->lock, flags); |
181 | 181 | ||
182 | DBG(dev, "enable %s %s %s maxpacket %u\n", ep->ep.name, | 182 | DBG(dev, "enable %s %s %s maxpacket %u\n", ep->ep.name, |
@@ -233,7 +233,6 @@ static void ep_reset(struct goku_udc_regs __iomem *regs, struct goku_ep *ep) | |||
233 | } | 233 | } |
234 | 234 | ||
235 | ep->ep.maxpacket = MAX_FIFO_SIZE; | 235 | ep->ep.maxpacket = MAX_FIFO_SIZE; |
236 | ep->desc = NULL; | ||
237 | ep->ep.desc = NULL; | 236 | ep->ep.desc = NULL; |
238 | ep->stopped = 1; | 237 | ep->stopped = 1; |
239 | ep->irqs = 0; | 238 | ep->irqs = 0; |
@@ -247,7 +246,7 @@ static int goku_ep_disable(struct usb_ep *_ep) | |||
247 | unsigned long flags; | 246 | unsigned long flags; |
248 | 247 | ||
249 | ep = container_of(_ep, struct goku_ep, ep); | 248 | ep = container_of(_ep, struct goku_ep, ep); |
250 | if (!_ep || !ep->desc) | 249 | if (!_ep || !ep->ep.desc) |
251 | return -ENODEV; | 250 | return -ENODEV; |
252 | dev = ep->dev; | 251 | dev = ep->dev; |
253 | if (dev->ep0state == EP0_SUSPEND) | 252 | if (dev->ep0state == EP0_SUSPEND) |
@@ -722,7 +721,7 @@ goku_queue(struct usb_ep *_ep, struct usb_request *_req, gfp_t gfp_flags) | |||
722 | || !_req->buf || !list_empty(&req->queue))) | 721 | || !_req->buf || !list_empty(&req->queue))) |
723 | return -EINVAL; | 722 | return -EINVAL; |
724 | ep = container_of(_ep, struct goku_ep, ep); | 723 | ep = container_of(_ep, struct goku_ep, ep); |
725 | if (unlikely(!_ep || (!ep->desc && ep->num != 0))) | 724 | if (unlikely(!_ep || (!ep->ep.desc && ep->num != 0))) |
726 | return -EINVAL; | 725 | return -EINVAL; |
727 | dev = ep->dev; | 726 | dev = ep->dev; |
728 | if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) | 727 | if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) |
@@ -815,7 +814,7 @@ static int goku_dequeue(struct usb_ep *_ep, struct usb_request *_req) | |||
815 | unsigned long flags; | 814 | unsigned long flags; |
816 | 815 | ||
817 | ep = container_of(_ep, struct goku_ep, ep); | 816 | ep = container_of(_ep, struct goku_ep, ep); |
818 | if (!_ep || !_req || (!ep->desc && ep->num != 0)) | 817 | if (!_ep || !_req || (!ep->ep.desc && ep->num != 0)) |
819 | return -EINVAL; | 818 | return -EINVAL; |
820 | dev = ep->dev; | 819 | dev = ep->dev; |
821 | if (!dev->driver) | 820 | if (!dev->driver) |
@@ -896,7 +895,7 @@ static int goku_set_halt(struct usb_ep *_ep, int value) | |||
896 | return -EINVAL; | 895 | return -EINVAL; |
897 | 896 | ||
898 | /* don't change EPxSTATUS_EP_INVALID to READY */ | 897 | /* don't change EPxSTATUS_EP_INVALID to READY */ |
899 | } else if (!ep->desc) { | 898 | } else if (!ep->ep.desc) { |
900 | DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); | 899 | DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); |
901 | return -EINVAL; | 900 | return -EINVAL; |
902 | } | 901 | } |
@@ -955,7 +954,7 @@ static void goku_fifo_flush(struct usb_ep *_ep) | |||
955 | VDBG(ep->dev, "%s %s\n", __func__, ep->ep.name); | 954 | VDBG(ep->dev, "%s %s\n", __func__, ep->ep.name); |
956 | 955 | ||
957 | /* don't change EPxSTATUS_EP_INVALID to READY */ | 956 | /* don't change EPxSTATUS_EP_INVALID to READY */ |
958 | if (!ep->desc && ep->num != 0) { | 957 | if (!ep->ep.desc && ep->num != 0) { |
959 | DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); | 958 | DBG(ep->dev, "%s %s inactive?\n", __func__, ep->ep.name); |
960 | return; | 959 | return; |
961 | } | 960 | } |
@@ -1152,7 +1151,7 @@ udc_proc_read(char *buffer, char **start, off_t off, int count, | |||
1152 | struct goku_ep *ep = &dev->ep [i]; | 1151 | struct goku_ep *ep = &dev->ep [i]; |
1153 | struct goku_request *req; | 1152 | struct goku_request *req; |
1154 | 1153 | ||
1155 | if (i && !ep->desc) | 1154 | if (i && !ep->ep.desc) |
1156 | continue; | 1155 | continue; |
1157 | 1156 | ||
1158 | tmp = readl(ep->reg_status); | 1157 | tmp = readl(ep->reg_status); |
@@ -1473,7 +1472,8 @@ static void ep0_setup(struct goku_udc *dev) | |||
1473 | case USB_RECIP_ENDPOINT: | 1472 | case USB_RECIP_ENDPOINT: |
1474 | tmp = le16_to_cpu(ctrl.wIndex) & 0x0f; | 1473 | tmp = le16_to_cpu(ctrl.wIndex) & 0x0f; |
1475 | /* active endpoint */ | 1474 | /* active endpoint */ |
1476 | if (tmp > 3 || (!dev->ep[tmp].desc && tmp != 0)) | 1475 | if (tmp > 3 || |
1476 | (!dev->ep[tmp].ep.desc && tmp != 0)) | ||
1477 | goto stall; | 1477 | goto stall; |
1478 | if (ctrl.wIndex & cpu_to_le16( | 1478 | if (ctrl.wIndex & cpu_to_le16( |
1479 | USB_DIR_IN)) { | 1479 | USB_DIR_IN)) { |