diff options
author | Ido Shayevitz <idos@codeaurora.org> | 2012-03-12 14:25:26 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:52:53 -0400 |
commit | 5a6506f00efa4b38b181152b69a072e766c7ce92 (patch) | |
tree | 4875b3ee5f146d8405c3bf97197d740c4d518441 | |
parent | ef20a72b7372e5643b157bd61bbdcf0f6ed1e330 (diff) |
usb: gadget: Update at91_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/at91_udc.c | 15 | ||||
-rw-r--r-- | drivers/usb/gadget/at91_udc.h | 3 |
2 files changed, 7 insertions, 11 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 9d7bcd910074..86cc9097a5cf 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -212,7 +212,7 @@ static int proc_udc_show(struct seq_file *s, void *unused) | |||
212 | if (udc->enabled && udc->vbus) { | 212 | if (udc->enabled && udc->vbus) { |
213 | proc_ep_show(s, &udc->ep[0]); | 213 | proc_ep_show(s, &udc->ep[0]); |
214 | list_for_each_entry (ep, &udc->gadget.ep_list, ep.ep_list) { | 214 | list_for_each_entry (ep, &udc->gadget.ep_list, ep.ep_list) { |
215 | if (ep->desc) | 215 | if (ep->ep.desc) |
216 | proc_ep_show(s, ep); | 216 | proc_ep_show(s, ep); |
217 | } | 217 | } |
218 | } | 218 | } |
@@ -530,7 +530,7 @@ ok: | |||
530 | tmp |= AT91_UDP_EPEDS; | 530 | tmp |= AT91_UDP_EPEDS; |
531 | __raw_writel(tmp, ep->creg); | 531 | __raw_writel(tmp, ep->creg); |
532 | 532 | ||
533 | ep->desc = desc; | 533 | ep->ep.desc = desc; |
534 | ep->ep.maxpacket = maxpacket; | 534 | ep->ep.maxpacket = maxpacket; |
535 | 535 | ||
536 | /* | 536 | /* |
@@ -558,7 +558,6 @@ static int at91_ep_disable (struct usb_ep * _ep) | |||
558 | nuke(ep, -ESHUTDOWN); | 558 | nuke(ep, -ESHUTDOWN); |
559 | 559 | ||
560 | /* restore the endpoint's pristine config */ | 560 | /* restore the endpoint's pristine config */ |
561 | ep->desc = NULL; | ||
562 | ep->ep.desc = NULL; | 561 | ep->ep.desc = NULL; |
563 | ep->ep.maxpacket = ep->maxpacket; | 562 | ep->ep.maxpacket = ep->maxpacket; |
564 | 563 | ||
@@ -618,7 +617,7 @@ static int at91_ep_queue(struct usb_ep *_ep, | |||
618 | return -EINVAL; | 617 | return -EINVAL; |
619 | } | 618 | } |
620 | 619 | ||
621 | if (!_ep || (!ep->desc && ep->ep.name != ep0name)) { | 620 | if (!_ep || (!ep->ep.desc && ep->ep.name != ep0name)) { |
622 | DBG("invalid ep\n"); | 621 | DBG("invalid ep\n"); |
623 | return -EINVAL; | 622 | return -EINVAL; |
624 | } | 623 | } |
@@ -833,7 +832,7 @@ static void udc_reinit(struct at91_udc *udc) | |||
833 | 832 | ||
834 | if (i != 0) | 833 | if (i != 0) |
835 | list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); | 834 | list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list); |
836 | ep->desc = NULL; | 835 | ep->ep.desc = NULL; |
837 | ep->stopped = 0; | 836 | ep->stopped = 0; |
838 | ep->fifo_bank = 0; | 837 | ep->fifo_bank = 0; |
839 | ep->ep.maxpacket = ep->maxpacket; | 838 | ep->ep.maxpacket = ep->maxpacket; |
@@ -1172,7 +1171,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1172 | | USB_REQ_GET_STATUS: | 1171 | | USB_REQ_GET_STATUS: |
1173 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; | 1172 | tmp = w_index & USB_ENDPOINT_NUMBER_MASK; |
1174 | ep = &udc->ep[tmp]; | 1173 | ep = &udc->ep[tmp]; |
1175 | if (tmp >= NUM_ENDPOINTS || (tmp && !ep->desc)) | 1174 | if (tmp >= NUM_ENDPOINTS || (tmp && !ep->ep.desc)) |
1176 | goto stall; | 1175 | goto stall; |
1177 | 1176 | ||
1178 | if (tmp) { | 1177 | if (tmp) { |
@@ -1197,7 +1196,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1197 | ep = &udc->ep[tmp]; | 1196 | ep = &udc->ep[tmp]; |
1198 | if (w_value != USB_ENDPOINT_HALT || tmp >= NUM_ENDPOINTS) | 1197 | if (w_value != USB_ENDPOINT_HALT || tmp >= NUM_ENDPOINTS) |
1199 | goto stall; | 1198 | goto stall; |
1200 | if (!ep->desc || ep->is_iso) | 1199 | if (!ep->ep.desc || ep->is_iso) |
1201 | goto stall; | 1200 | goto stall; |
1202 | if ((w_index & USB_DIR_IN)) { | 1201 | if ((w_index & USB_DIR_IN)) { |
1203 | if (!ep->is_in) | 1202 | if (!ep->is_in) |
@@ -1218,7 +1217,7 @@ static void handle_setup(struct at91_udc *udc, struct at91_ep *ep, u32 csr) | |||
1218 | goto stall; | 1217 | goto stall; |
1219 | if (tmp == 0) | 1218 | if (tmp == 0) |
1220 | goto succeed; | 1219 | goto succeed; |
1221 | if (!ep->desc || ep->is_iso) | 1220 | if (!ep->ep.desc || ep->is_iso) |
1222 | goto stall; | 1221 | goto stall; |
1223 | if ((w_index & USB_DIR_IN)) { | 1222 | if ((w_index & USB_DIR_IN)) { |
1224 | if (!ep->is_in) | 1223 | if (!ep->is_in) |
diff --git a/drivers/usb/gadget/at91_udc.h b/drivers/usb/gadget/at91_udc.h index 3c0315b86ace..e647d1c2ada4 100644 --- a/drivers/usb/gadget/at91_udc.h +++ b/drivers/usb/gadget/at91_udc.h | |||
@@ -105,9 +105,6 @@ struct at91_ep { | |||
105 | unsigned is_in:1; | 105 | unsigned is_in:1; |
106 | unsigned is_iso:1; | 106 | unsigned is_iso:1; |
107 | unsigned fifo_bank:1; | 107 | unsigned fifo_bank:1; |
108 | |||
109 | const struct usb_endpoint_descriptor | ||
110 | *desc; | ||
111 | }; | 108 | }; |
112 | 109 | ||
113 | /* | 110 | /* |