aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/f_uvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/f_uvc.c')
-rw-r--r--drivers/usb/gadget/f_uvc.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index 28ff2546a5b3..5b629876941b 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -580,6 +580,7 @@ uvc_function_unbind(struct usb_configuration *c, struct usb_function *f)
580 uvc->control_ep->driver_data = NULL; 580 uvc->control_ep->driver_data = NULL;
581 uvc->video.ep->driver_data = NULL; 581 uvc->video.ep->driver_data = NULL;
582 582
583 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id = 0;
583 usb_ep_free_request(cdev->gadget->ep0, uvc->control_req); 584 usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
584 kfree(uvc->control_buf); 585 kfree(uvc->control_buf);
585 586
@@ -798,25 +799,16 @@ uvc_bind_config(struct usb_configuration *c,
798 uvc->desc.hs_streaming = hs_streaming; 799 uvc->desc.hs_streaming = hs_streaming;
799 uvc->desc.ss_streaming = ss_streaming; 800 uvc->desc.ss_streaming = ss_streaming;
800 801
801 /* maybe allocate device-global string IDs, and patch descriptors */ 802 /* Allocate string descriptor numbers. */
802 if (uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id == 0) { 803 if (uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id == 0) {
803 /* Allocate string descriptor numbers. */ 804 ret = usb_string_ids_tab(c->cdev, uvc_en_us_strings);
804 ret = usb_string_id(c->cdev); 805 if (ret)
805 if (ret < 0)
806 goto error; 806 goto error;
807 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id = ret; 807 uvc_iad.iFunction =
808 uvc_iad.iFunction = ret; 808 uvc_en_us_strings[UVC_STRING_ASSOCIATION_IDX].id;
809 809 uvc_control_intf.iInterface =
810 ret = usb_string_id(c->cdev); 810 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id;
811 if (ret < 0) 811 ret = uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id;
812 goto error;
813 uvc_en_us_strings[UVC_STRING_CONTROL_IDX].id = ret;
814 uvc_control_intf.iInterface = ret;
815
816 ret = usb_string_id(c->cdev);
817 if (ret < 0)
818 goto error;
819 uvc_en_us_strings[UVC_STRING_STREAMING_IDX].id = ret;
820 uvc_streaming_intf_alt0.iInterface = ret; 812 uvc_streaming_intf_alt0.iInterface = ret;
821 uvc_streaming_intf_alt1.iInterface = ret; 813 uvc_streaming_intf_alt1.iInterface = ret;
822 } 814 }