summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-12-23 11:35:17 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2008-12-23 11:35:17 +0100
commit85eea3e7c4e6c0b3196466d9b14a8965cc751003 (patch)
treef618d53730d96aa56754c3f7219ba9a1e7753ff6 /linux/drivers/media/video/v4l2-dev.c
parenta012e750305d20ec8b2f79b6a32c5e7920096fd3 (diff)
downloadmediapointer-dvb-s2-85eea3e7c4e6c0b3196466d9b14a8965cc751003.tar.gz
mediapointer-dvb-s2-85eea3e7c4e6c0b3196466d9b14a8965cc751003.tar.bz2
v4l2-dev: allow drivers to pass v4l2_device as parent
From: Hans Verkuil <hverkuil@xs4all.nl> Drivers that use v4l2_device can set that as parent pointer in the v4l2_dev field instead of using the struct device parent field. This allows v4l2-dev.c to check whether this driver is v4l2_device based, and if so then it can offer additional services. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/v4l2-dev.c')
-rw-r--r--linux/drivers/media/video/v4l2-dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index f877d3f86..0b832f210 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -30,6 +30,7 @@
#include <asm/system.h>
#include <media/v4l2-common.h>
+#include <media/v4l2-device.h>
#include "compat.h"
#define VIDEO_NUM_DEVICES 256
@@ -445,6 +446,8 @@ int video_register_device_index(struct video_device *vdev, int type, int nr,
vdev->vfl_type = type;
vdev->cdev = NULL;
+ if (vdev->v4l2_dev)
+ vdev->parent = vdev->v4l2_dev->dev;
/* Part 2: find a free minor, kernel number and device index. */
#ifdef CONFIG_VIDEO_FIXED_MINOR_RANGES