diff options
Diffstat (limited to 'drivers/usb/gadget/f_uac1.c')
-rw-r--r-- | drivers/usb/gadget/f_uac1.c | 22 |
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c index c8ed41ba1042..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) | |||
630 | struct usb_composite_dev *cdev = c->cdev; | 630 | struct usb_composite_dev *cdev = c->cdev; |
631 | struct f_audio *audio = func_to_audio(f); | 631 | struct f_audio *audio = func_to_audio(f); |
632 | int status; | 632 | int status; |
633 | struct usb_ep *ep; | 633 | struct usb_ep *ep = NULL; |
634 | 634 | ||
635 | f_audio_build_desc(audio); | 635 | f_audio_build_desc(audio); |
636 | 636 | ||
@@ -659,21 +659,14 @@ f_audio_bind(struct usb_configuration *c, struct usb_function *f) | |||
659 | status = -ENOMEM; | 659 | status = -ENOMEM; |
660 | 660 | ||
661 | /* copy descriptors, and track endpoint copies */ | 661 | /* copy descriptors, and track endpoint copies */ |
662 | f->descriptors = usb_copy_descriptors(f_audio_desc); | 662 | status = usb_assign_descriptors(f, f_audio_desc, f_audio_desc, NULL); |
663 | 663 | if (status) | |
664 | /* | 664 | goto fail; |
665 | * support all relevant hardware speeds... we expect that when | ||
666 | * hardware is dual speed, all bulk-capable endpoints work at | ||
667 | * both speeds | ||
668 | */ | ||
669 | if (gadget_is_dualspeed(c->cdev->gadget)) { | ||
670 | f->hs_descriptors = usb_copy_descriptors(f_audio_desc); | ||
671 | } | ||
672 | |||
673 | return 0; | 665 | return 0; |
674 | 666 | ||
675 | fail: | 667 | fail: |
676 | 668 | if (ep) | |
669 | ep->driver_data = NULL; | ||
677 | return status; | 670 | return status; |
678 | } | 671 | } |
679 | 672 | ||
@@ -682,8 +675,7 @@ f_audio_unbind(struct usb_configuration *c, struct usb_function *f) | |||
682 | { | 675 | { |
683 | struct f_audio *audio = func_to_audio(f); | 676 | struct f_audio *audio = func_to_audio(f); |
684 | 677 | ||
685 | usb_free_descriptors(f->descriptors); | 678 | usb_free_all_descriptors(f); |
686 | usb_free_descriptors(f->hs_descriptors); | ||
687 | kfree(audio); | 679 | kfree(audio); |
688 | } | 680 | } |
689 | 681 | ||