diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-12-23 05:35:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:39:35 -0500 |
commit | 9bea3514dd4a44490b53cc52498b2967e48056dd (patch) | |
tree | 5aa2003666cd073a1aec46145fdf99147d35be28 /drivers/media/video/v4l2-dev.c | |
parent | dc93a70cc7f92e1dbaf29fa7dfd914b0f618fb31 (diff) |
V4L/DVB (9974): v4l2-dev: allow drivers to pass v4l2_device as parent
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.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 3 |
1 files changed, 3 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 |