summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget/f_uac1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_uac1.c')
-rw-r--r--drivers/usb/gadget/f_uac1.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c
index 1a5dcd5565e3..f570e667a640 100644
--- a/drivers/usb/gadget/f_uac1.c
+++ b/drivers/usb/gadget/f_uac1.c
@@ -630,7 +630,7 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
struct usb_composite_dev *cdev = c->cdev;
struct f_audio *audio = func_to_audio(f);
int status;
- struct usb_ep *ep;
+ struct usb_ep *ep = NULL;
f_audio_build_desc(audio);
@@ -659,22 +659,14 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f)
status = -ENOMEM;
/* copy descriptors, and track endpoint copies */
- f->descriptors = usb_copy_descriptors(f_audio_desc);
-
- /*
- * support all relevant hardware speeds... we expect that when
- * hardware is dual speed, all bulk-capable endpoints work at
- * both speeds
- */
- if (gadget_is_dualspeed(c->cdev->gadget)) {
- c->highspeed = true;
- f->hs_descriptors = usb_copy_descriptors(f_audio_desc);
- }
-
+ status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL);
+ if (status)
+ goto fail;
return 0;
fail:
-
+ if (ep)
+ ep->driver_data = NULL;
return status;
}
@@ -683,8 +675,7 @@ f_audio_unbind(struct usb_configuration *c, struct usb_function *f)
{
struct f_audio *audio = func_to_audio(f);
- usb_free_descriptors(f->descriptors);
- usb_free_descriptors(f->hs_descriptors);
+ usb_free_all_descriptors(f);
kfree(audio);
}