summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_phonet.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2011-07-28 15:25:46 (GMT)
committerArnd Bergmann <arnd@arndb.de>2011-07-28 15:25:46 (GMT)
commit6124a4e430b64d1577438c8648c59e996d02e73e (patch)
tree49cfafad785d1c9e403a5b0d755298b9af2c260f /drivers/usb/gadget/f_phonet.c
parent8e267f3da5f117d2f1316cf6ddf740f93f1c73aa (diff)
parent580975d7f48d7d047e22bb0f42adf7557801d8d4 (diff)
downloadlinux-fsl-qoriq-6124a4e430b64d1577438c8648c59e996d02e73e.tar.xz
Merge branch 'imx/dt' into next/dt
Diffstat (limited to 'drivers/usb/gadget/f_phonet.c')
-rw-r--r--drivers/usb/gadget/f_phonet.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index f22fc68..8f8d3f6 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -428,17 +428,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,
- &pn_hs_sink_desc,
- &pn_fs_sink_desc);
- in = 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);
+ if (config_ep_by_speed(gadget, f, fp->in_ep) ||
+ config_ep_by_speed(gadget, f, fp->out_ep)) {
+ fp->in_ep->desc = NULL;
+ fp->out_ep->desc = NULL;
+ return -EINVAL;
+ }
+ usb_ep_enable(fp->out_ep);
+ usb_ep_enable(fp->in_ep);
port->usb = fp;
fp->out_ep->driver_data = fp;