aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/v4l2-dev.c3
-rw-r--r--include/media/v4l2-dev.h4
2 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 4e0db8845e04..7ad6711ee327 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -30,6 +30,7 @@
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32#include <media/v4l2-common.h> 32#include <media/v4l2-common.h>
33#include <media/v4l2-device.h>
33 34
34#define VIDEO_NUM_DEVICES 256 35#define VIDEO_NUM_DEVICES 256
35#define VIDEO_NAME "video4linux" 36#define VIDEO_NAME "video4linux"
@@ -407,6 +408,8 @@ int video_register_device_index(struct video_device *vdev, int type, int nr,
407 408
408 vdev->vfl_type = type; 409 vdev->vfl_type = type;
409 vdev->cdev = NULL; 410 vdev->cdev = NULL;
411 if (vdev->v4l2_dev)
412 vdev->parent = vdev->v4l2_dev->dev;
410 413
411 /* Part 2: find a free minor, kernel number and device index. */ 414 /* Part 2: find a free minor, kernel number and device index. */
412#ifdef CONFIG_VIDEO_FIXED_MINOR_RANGES 415#ifdef CONFIG_VIDEO_FIXED_MINOR_RANGES
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index e0d72d2c6f0e..0a88d1d17d30 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -25,6 +25,7 @@
25#define VFL_TYPE_MAX 4 25#define VFL_TYPE_MAX 4
26 26
27struct v4l2_ioctl_callbacks; 27struct v4l2_ioctl_callbacks;
28struct v4l2_device;
28 29
29/* Flag to mark the video_device struct as unregistered. 30/* Flag to mark the video_device struct as unregistered.
30 Drivers can set this flag if they want to block all future 31 Drivers can set this flag if they want to block all future
@@ -45,7 +46,10 @@ struct video_device
45 /* sysfs */ 46 /* sysfs */
46 struct device dev; /* v4l device */ 47 struct device dev; /* v4l device */
47 struct cdev *cdev; /* character device */ 48 struct cdev *cdev; /* character device */
49
50 /* Set either parent or v4l2_dev if your driver uses v4l2_device */
48 struct device *parent; /* device parent */ 51 struct device *parent; /* device parent */
52 struct v4l2_device *v4l2_dev; /* v4l2_device parent */
49 53
50 /* device info */ 54 /* device info */
51 char name[32]; 55 char name[32];