summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2014-09-29 22:43:20 +0400
committerFelipe Balbi <balbi@ti.com>2014-10-21 00:58:48 +0400
commite3122f5fedb6d88a043b60822f601f7ab517a465 (patch)
treeb67d18119cf553f96ec5b3f01b9aeead2bee3d25 /drivers/usb/gadget
parent62e370785cb337981999ac7ec364e22ffb6c2cd3 (diff)
downloadlinux-e3122f5fedb6d88a043b60822f601f7ab517a465.tar.xz
usb: gadget: function: uvc: disable endpoints on ->disable()
when our ->disable() method is called, we must make sure to teardown all our resources, including endpoints. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/function/f_uvc.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/f_uvc.c b/drivers/usb/gadget/function/f_uvc.c
index 413a09f366c4..945b3bd2ca98 100644
--- a/drivers/usb/gadget/function/f_uvc.c
+++ b/drivers/usb/gadget/function/f_uvc.c
@@ -390,6 +390,16 @@ uvc_function_disable(struct usb_function *f)
v4l2_event_queue(uvc->vdev, &v4l2_event);
uvc->state = UVC_STATE_DISCONNECTED;
+
+ if (uvc->video.ep->driver_data) {
+ usb_ep_disable(uvc->video.ep);
+ uvc->video.ep->driver_data = NULL;
+ }
+
+ if (uvc->control_ep->driver_data) {
+ usb_ep_disable(uvc->control_ep);
+ uvc->control_ep->driver_data = NULL;
+ }
}
/* --------------------------------------------------------------------------