===================================================================
@@ -1544,6 +1544,9 @@ static void uvc_delete(struct uvc_device
uvc_status_cleanup(dev);
uvc_ctrl_cleanup_device(dev);
+ if (dev->vdev.name[0])
+ v4l2_device_unregister(&dev->vdev);
+
list_for_each_safe(p, n, &dev->chains) {
struct uvc_video_chain *chain;
chain = list_entry(p, struct uvc_video_chain, list);
@@ -1641,7 +1644,7 @@ static int uvc_register_video(struct uvc
* unregistered before the reference is released, so we don't need to
* get another one.
*/
- vdev->parent = &dev->intf->dev;
+ vdev->entity.parent = &dev->vdev;
vdev->minor = -1;
vdev->fops = &uvc_fops;
vdev->release = uvc_release;
@@ -1772,6 +1775,10 @@ static int uvc_probe(struct usb_interfac
"linux-uvc-devel mailing list.\n");
}
+ /* Register the V4L2 device. */
+ if (v4l2_device_register(&intf->dev, &dev->vdev) < 0)
+ goto error;
+
/* Initialize controls. */
if (uvc_ctrl_init_device(dev) < 0)
goto error;
@@ -1780,7 +1787,7 @@ static int uvc_probe(struct usb_interfac
if (uvc_scan_device(dev) < 0)
goto error;
- /* Register video devices. */
+ /* Register video device nodes. */
if (uvc_register_chains(dev) < 0)
goto error;
===================================================================
@@ -68,6 +68,7 @@ struct uvc_xu_control {
#include <linux/poll.h>
#include <linux/usb/video.h>
+#include <media/v4l2-device.h>
#include "compat.h"
/* --------------------------------------------------------------------------
@@ -476,6 +477,7 @@ struct uvc_device {
atomic_t users;
/* Video control interface */
+ struct v4l2_device vdev;
__u16 uvc_version;
__u32 clock_frequency;