@@ -1834,7 +1834,11 @@ static void uvc_delete(struct kref *kref)
usb_put_intf(dev->intf);
usb_put_dev(dev->udev);
+ if (dev->vdev.dev)
+ v4l2_device_unregister(&dev->vdev);
#ifdef CONFIG_MEDIA_CONTROLLER
+ if (media_devnode_is_registered(dev->mdev.devnode))
+ media_device_unregister(&dev->mdev);
media_device_cleanup(&dev->mdev);
#endif
@@ -1891,15 +1895,6 @@ static void uvc_unregister_video(struct uvc_device *dev)
uvc_debugfs_cleanup_stream(stream);
}
-
- uvc_status_unregister(dev);
-
- if (dev->vdev.dev)
- v4l2_device_unregister(&dev->vdev);
-#ifdef CONFIG_MEDIA_CONTROLLER
- if (media_devnode_is_registered(dev->mdev.devnode))
- media_device_unregister(&dev->mdev);
-#endif
}
int uvc_register_video_device(struct uvc_device *dev,
@@ -73,7 +73,7 @@ static int uvc_input_init(struct uvc_device *dev)
return ret;
}
-static void uvc_input_unregister(struct uvc_device *dev)
+static void uvc_input_cleanup(struct uvc_device *dev)
{
if (dev->input)
input_unregister_device(dev->input);
@@ -90,7 +90,7 @@ static void uvc_input_report_key(struct uvc_device *dev, unsigned int code,
#else
#define uvc_input_init(dev)
-#define uvc_input_unregister(dev)
+#define uvc_input_cleanup(dev)
#define uvc_input_report_key(dev, code, value)
#endif /* CONFIG_USB_VIDEO_CLASS_INPUT_EVDEV */
@@ -290,16 +290,12 @@ int uvc_status_init(struct uvc_device *dev)
return 0;
}
-void uvc_status_unregister(struct uvc_device *dev)
-{
- usb_kill_urb(dev->int_urb);
- uvc_input_unregister(dev);
-}
-
void uvc_status_cleanup(struct uvc_device *dev)
{
+ usb_kill_urb(dev->int_urb);
usb_free_urb(dev->int_urb);
kfree(dev->status);
+ uvc_input_cleanup(dev);
}
int uvc_status_start(struct uvc_device *dev, gfp_t flags)
@@ -742,7 +742,6 @@ int uvc_register_video_device(struct uvc_device *dev,
/* Status */
int uvc_status_init(struct uvc_device *dev);
-void uvc_status_unregister(struct uvc_device *dev);
void uvc_status_cleanup(struct uvc_device *dev);
int uvc_status_start(struct uvc_device *dev, gfp_t flags);
void uvc_status_stop(struct uvc_device *dev);
This reverts commit 10e1fdb95809ed21406f53b5b4f064673a1b9ceb. Temporarily revert this patch to revert a dependent patch. The patch is re-applied later, rebased on the revert. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/usb/uvc/uvc_driver.c | 13 ++++--------- drivers/media/usb/uvc/uvc_status.c | 12 ++++-------- drivers/media/usb/uvc/uvcvideo.h | 1 - 3 files changed, 8 insertions(+), 18 deletions(-)