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_audio.c | |
parent | 0f91349b89f37dfad7b77f7829a105b6a0f526ec (diff) | |
download | op-kernel-dev-72c973dd2b01b212a159faa330a2bc641a3ed809.zip op-kernel-dev-72c973dd2b01b212a159faa330a2bc641a3ed809.tar.gz |
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_audio.c')
-rw-r--r-- | drivers/usb/gadget/f_audio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_audio.c b/drivers/usb/gadget/f_audio.c index 8ee330a..02a0270 100644 --- a/drivers/usb/gadget/f_audio.c +++ b/drivers/usb/gadget/f_audio.c @@ -279,7 +279,6 @@ struct f_audio { /* endpoints handle full and/or high speeds */ struct usb_ep *out_ep; - struct usb_endpoint_descriptor *out_desc; spinlock_t lock; struct f_audio_buf *copy_buf; @@ -575,7 +574,7 @@ static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned alt) if (intf == 1) { if (alt == 1) { - usb_ep_enable(out_ep, audio->out_desc); + usb_ep_enable(out_ep); out_ep->driver_data = audio; audio->copy_buf = f_audio_buffer_alloc(audio_buf_size); if (IS_ERR(audio->copy_buf)) @@ -677,6 +676,7 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) if (!ep) goto fail; audio->out_ep = ep; + audio->out_ep->desc = &as_out_ep_desc; ep->driver_data = cdev; /* claim */ status = -ENOMEM; @@ -776,7 +776,6 @@ int __init audio_bind_config(struct usb_configuration *c) audio->card.func.set_alt = f_audio_set_alt; audio->card.func.setup = f_audio_setup; audio->card.func.disable = f_audio_disable; - audio->out_desc = &as_out_ep_desc; control_selector_init(audio); |