ANDROID: usb: gadget: uvc: remove duplicate code in unbind

The uvc_function_unbind() was calling the same code two times,
increasing a timeout that may occur. The duplicate code looks to have
come in during the merge of 5.10.117. Remove the duplicate code.

Bug: 261895714
Change-Id: I8957048bfad4a9e01baea033de9b628362b2d991
Signed-off-by: Dan Vacura <w36195@motorola.com>
This commit is contained in:
Dan Vacura
2022-12-08 15:30:21 -06:00
committed by Treehugger Robot
parent 202ee06349
commit d31626cbea

View File

@@ -906,18 +906,6 @@ static void uvc_function_unbind(struct usb_configuration *c,
uvcg_dbg(f, "done waiting with ret: %ld\n", wait_ret); uvcg_dbg(f, "done waiting with ret: %ld\n", wait_ret);
} }
/* If we know we're connected via v4l2, then there should be a cleanup
* of the device from userspace either via UVC_EVENT_DISCONNECT or
* though the video device removal uevent. Allow some time for the
* application to close out before things get deleted.
*/
if (uvc->func_connected) {
uvcg_dbg(f, "waiting for clean disconnect\n");
wait_ret = wait_event_interruptible_timeout(uvc->func_connected_queue,
uvc->func_connected == false, msecs_to_jiffies(500));
uvcg_dbg(f, "done waiting with ret: %ld\n", wait_ret);
}
device_remove_file(&uvc->vdev.dev, &dev_attr_function_name); device_remove_file(&uvc->vdev.dev, &dev_attr_function_name);
video_unregister_device(&uvc->vdev); video_unregister_device(&uvc->vdev);
v4l2_device_unregister(&uvc->v4l2_dev); v4l2_device_unregister(&uvc->v4l2_dev);