From 72c973dd2b01b212a159faa330a2bc641a3ed809 Mon Sep 17 00:00:00 2001 From: Tatyana Brokhman Date: Tue, 28 Jun 2011 16:33:48 +0300 Subject: 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 Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/f_eem.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/usb/gadget/f_eem.c') 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) gether_disconnect(&eem->port); } - if (!eem->port.in) { + if (!eem->port.in_ep->desc) { DBG(cdev, "init eem\n"); - eem->port.in = ep_choose(cdev->gadget, + eem->port.in_ep->desc = ep_choose(cdev->gadget, eem->hs.in, eem->fs.in); - eem->port.out = ep_choose(cdev->gadget, + eem->port.out_ep->desc = ep_choose(cdev->gadget, eem->hs.out, eem->fs.out); } @@ -289,9 +289,9 @@ fail: usb_free_descriptors(f->descriptors); /* we might as well release our claims on endpoints */ - if (eem->port.out) + if (eem->port.out_ep->desc) eem->port.out_ep->driver_data = NULL; - if (eem->port.in) + if (eem->port.in_ep->desc) eem->port.in_ep->driver_data = NULL; ERROR(cdev, "%s: can't bind, err %d\n", f->name, status); -- cgit v1.2.3