summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_phonet.c
diff options
context:
space:
mode:
authorTatyana Brokhman2011-06-28 15:33:48 +0200
committerGreg Kroah-Hartman2011-06-28 20:14:36 +0200
commit72c973dd2b01b212a159faa330a2bc641a3ed809 (patch)
tree2fbc36b4103678cd9b7599deaab06f89e4871de2 /drivers/usb/gadget/f_phonet.c
parentusb: gadget: convert all users to the new udc infrastructure (diff)
downloadkernel-qcow2-linux-72c973dd2b01b212a159faa330a2bc641a3ed809.tar.gz
kernel-qcow2-linux-72c973dd2b01b212a159faa330a2bc641a3ed809.tar.xz
kernel-qcow2-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_phonet.c')
-rw-r--r--drivers/usb/gadget/f_phonet.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index 5e1495097ec3..dc63f161a10a 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -427,17 +427,16 @@ static int pn_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
spin_lock(&port->lock);
__pn_reset(f);
if (alt == 1) {
- struct usb_endpoint_descriptor *out, *in;
int i;
- out = ep_choose(gadget,
+ fp->out_ep->desc = ep_choose(gadget,
&pn_hs_sink_desc,
&pn_fs_sink_desc);
- in = ep_choose(gadget,
+ fp->in_ep->desc = ep_choose(gadget,
&pn_hs_source_desc,
&pn_fs_source_desc);
- usb_ep_enable(fp->out_ep, out);
- usb_ep_enable(fp->in_ep, in);
+ usb_ep_enable(fp->out_ep);
+ usb_ep_enable(fp->in_ep);
port->usb = fp;
fp->out_ep->driver_data = fp;