Skip to content

Commit 3c5b006

Browse files
Linyu Yuangregkh
authored andcommitted
usb: gadget: f_uvc: change endpoint allocation in uvc_function_bind()
when call uvc_function_bind(), gadget still have no connection speed, just follow other gadget function, use fs endpoint descriptor to allocate a video endpoint, remove gadget_is_{super|dual}speed() API call. Signed-off-by: Linyu Yuan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8165763 commit 3c5b006

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

drivers/usb/gadget/function/f_uvc.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -719,21 +719,13 @@ uvc_function_bind(struct usb_configuration *c, struct usb_function *f)
719719
}
720720
uvc->enable_interrupt_ep = opts->enable_interrupt_ep;
721721

722-
if (gadget_is_superspeed(c->cdev->gadget))
723-
ep = usb_ep_autoconfig_ss(cdev->gadget, &uvc_ss_streaming_ep,
724-
&uvc_ss_streaming_comp);
725-
else if (gadget_is_dualspeed(cdev->gadget))
726-
ep = usb_ep_autoconfig(cdev->gadget, &uvc_hs_streaming_ep);
727-
else
728-
ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
729-
722+
ep = usb_ep_autoconfig(cdev->gadget, &uvc_fs_streaming_ep);
730723
if (!ep) {
731724
uvcg_info(f, "Unable to allocate streaming EP\n");
732725
goto error;
733726
}
734727
uvc->video.ep = ep;
735728

736-
uvc_fs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
737729
uvc_hs_streaming_ep.bEndpointAddress = uvc->video.ep->address;
738730
uvc_ss_streaming_ep.bEndpointAddress = uvc->video.ep->address;
739731

0 commit comments

Comments
 (0)