aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_eem.c
diff options
context:
space:
mode:
authorTatyana Brokhman <tlinder@codeaurora.org>2011-06-28 09:33:48 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-28 14:14:36 -0400
commit72c973dd2b01b212a159faa330a2bc641a3ed809 (patch)
tree2fbc36b4103678cd9b7599deaab06f89e4871de2 /drivers/usb/gadget/f_eem.c
parent0f91349b89f37dfad7b77f7829a105b6a0f526ec (diff)
usb: gadget: add usb_endpoint_descriptor to struct usb_ep
Change usb_ep_enable() prototype to use endpoint descriptor from usb_ep. This optimization spares the FDs from saving the endpoint chosen descriptor. This optimization is not full though. To fully exploit this change, one needs to update all the UDCs as well since in the current implementation each of them saves the endpoint descriptor in it's internal (and extended) endpoint structure. Signed-off-by: Tatyana Brokhman <tlinder@codeaurora.org> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/f_eem.c')
-rw-r--r--drivers/usb/gadget/f_eem.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c
index b3c304290150..fea8e3b08b5f 100644
--- a/drivers/usb/gadget/f_eem.c
+++ b/drivers/usb/gadget/f_eem.c
@@ -176,11 +176,11 @@ static int eem_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
176 gether_disconnect(&eem->port); 176 gether_disconnect(&eem->port);
177 } 177 }
178 178
179 if (!eem->port.in) { 179 if (!eem->port.in_ep->desc) {
180 DBG(cdev, "init eem\n"); 180 DBG(cdev, "init eem\n");
181 eem->port.in = ep_choose(cdev->gadget, 181 eem->port.in_ep->desc = ep_choose(cdev->gadget,
182 eem->hs.in, eem->fs.in); 182 eem->hs.in, eem->fs.in);
183 eem->port.out = ep_choose(cdev->gadget, 183 eem->port.out_ep->desc = ep_choose(cdev->gadget,
184 eem->hs.out, eem->fs.out); 184 eem->hs.out, eem->fs.out);
185 } 185 }
186 186
@@ -289,9 +289,9 @@ fail:
289 usb_free_descriptors(f->descriptors); 289 usb_free_descriptors(f->descriptors);
290 290
291 /* we might as well release our claims on endpoints */ 291 /* we might as well release our claims on endpoints */
292 if (eem->port.out) 292 if (eem->port.out_ep->desc)
293 eem->port.out_ep->driver_data = NULL; 293 eem->port.out_ep->driver_data = NULL;
294 if (eem->port.in) 294 if (eem->port.in_ep->desc)
295 eem->port.in_ep->driver_data = NULL; 295 eem->port.in_ep->driver_data = NULL;
296 296
297 ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); 297 ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);