diff options
author | Tatyana Brokhman <tlinder@codeaurora.org> | 2011-06-28 16:33:48 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-28 11:14:36 -0700 |
commit | 72c973dd2b01b212a159faa330a2bc641a3ed809 (patch) | |
tree | 2fbc36b4103678cd9b7599deaab06f89e4871de2 /drivers/usb/gadget/f_sourcesink.c | |
parent | 0f91349b89f37dfad7b77f7829a105b6a0f526ec (diff) | |
download | blackbird-op-linux-72c973dd2b01b212a159faa330a2bc641a3ed809.tar.gz blackbird-op-linux-72c973dd2b01b212a159faa330a2bc641a3ed809.zip |
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_sourcesink.c')
-rw-r--r-- | drivers/usb/gadget/f_sourcesink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/usb/gadget/f_sourcesink.c b/drivers/usb/gadget/f_sourcesink.c index e403a534dd55..0ffddd33a55c 100644 --- a/drivers/usb/gadget/f_sourcesink.c +++ b/drivers/usb/gadget/f_sourcesink.c @@ -343,15 +343,12 @@ static int enable_source_sink(struct usb_composite_dev *cdev, struct f_sourcesink *ss) { int result = 0; - const struct usb_endpoint_descriptor *src, *sink; struct usb_ep *ep; - src = ep_choose(cdev->gadget, &hs_source_desc, &fs_source_desc); - sink = ep_choose(cdev->gadget, &hs_sink_desc, &fs_sink_desc); - /* one endpoint writes (sources) zeroes IN (to the host) */ ep = ss->in_ep; - result = usb_ep_enable(ep, src); + ep->desc = ep_choose(cdev->gadget, &hs_source_desc, &fs_source_desc); + result = usb_ep_enable(ep); if (result < 0) return result; ep->driver_data = ss; @@ -367,7 +364,8 @@ fail: /* one endpoint reads (sinks) anything OUT (from the host) */ ep = ss->out_ep; - result = usb_ep_enable(ep, sink); + ep->desc = ep_choose(cdev->gadget, &hs_sink_desc, &fs_sink_desc); + result = usb_ep_enable(ep); if (result < 0) goto fail; ep->driver_data = ss; |