aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_hid.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_hid.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_hid.c')
-rw-r--r--drivers/usb/gadget/f_hid.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c
index 598e7e2ab80c..12879b6f787c 100644
--- a/drivers/usb/gadget/f_hid.c
+++ b/drivers/usb/gadget/f_hid.c
@@ -416,7 +416,6 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
416{ 416{
417 struct usb_composite_dev *cdev = f->config->cdev; 417 struct usb_composite_dev *cdev = f->config->cdev;
418 struct f_hidg *hidg = func_to_hidg(f); 418 struct f_hidg *hidg = func_to_hidg(f);
419 const struct usb_endpoint_descriptor *ep_desc;
420 int status = 0; 419 int status = 0;
421 420
422 VDBG(cdev, "hidg_set_alt intf:%d alt:%d\n", intf, alt); 421 VDBG(cdev, "hidg_set_alt intf:%d alt:%d\n", intf, alt);
@@ -426,9 +425,9 @@ static int hidg_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
426 if (hidg->in_ep->driver_data != NULL) 425 if (hidg->in_ep->driver_data != NULL)
427 usb_ep_disable(hidg->in_ep); 426 usb_ep_disable(hidg->in_ep);
428 427
429 ep_desc = ep_choose(f->config->cdev->gadget, 428 hidg->in_ep->desc = ep_choose(f->config->cdev->gadget,
430 hidg->hs_in_ep_desc, hidg->fs_in_ep_desc); 429 hidg->hs_in_ep_desc, hidg->fs_in_ep_desc);
431 status = usb_ep_enable(hidg->in_ep, ep_desc); 430 status = usb_ep_enable(hidg->in_ep);
432 if (status < 0) { 431 if (status < 0) {
433 ERROR(cdev, "Enable endpoint FAILED!\n"); 432 ERROR(cdev, "Enable endpoint FAILED!\n");
434 goto fail; 433 goto fail;