usb: gadget: function: uvc: disable endpoints on ->disable()
authorFelipe Balbi <balbi@ti.com>
Mon, 29 Sep 2014 18:43:20 +0000 (13:43 -0500)
committerFelipe Balbi <balbi@ti.com>
Mon, 20 Oct 2014 20:58:48 +0000 (15:58 -0500)
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>
drivers/usb/gadget/function/f_uvc.c

index 413a09f366c4e7b4c84fc097eb3332fc1a8ebfdb..945b3bd2ca98a4847c30ce7e462a691f944051b2 100644 (file)
@@ -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;
+       }
 }
 
 /* --------------------------------------------------------------------------
This page took 0.027776 seconds and 5 git commands to generate.