diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-05-16 09:24:06 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-08 23:43:04 -0300 |
commit | 11bbc1cadb638aaccb4764c6e16807b36b53cf19 (patch) | |
tree | 101be79d45abd28e30f5cc3ee6372004bf7880b9 /drivers/media/video/v4l2-device.c | |
parent | a42b57f5aacf2b43f3e7931e8b9c609051839aa8 (diff) |
V4L/DVB: v4l2: hook up the new control framework into the core framework
Add the calls needed to automatically merge subdev controls into a bridge
control handler.
Hook up the control framework in __video_ioctl2 and video_register_device.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-device.c')
-rw-r--r-- | drivers/media/video/v4l2-device.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-device.c b/drivers/media/video/v4l2-device.c index 5a7dc4afe92..0b08f96b74a 100644 --- a/drivers/media/video/v4l2-device.c +++ b/drivers/media/video/v4l2-device.c @@ -26,6 +26,7 @@ #endif #include <linux/videodev2.h> #include <media/v4l2-device.h> +#include <media/v4l2-ctrls.h> int v4l2_device_register(struct device *dev, struct v4l2_device *v4l2_dev) { @@ -115,6 +116,8 @@ EXPORT_SYMBOL_GPL(v4l2_device_unregister); int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, struct v4l2_subdev *sd) { + int err; + /* Check for valid input */ if (v4l2_dev == NULL || sd == NULL || !sd->name[0]) return -EINVAL; @@ -122,6 +125,10 @@ int v4l2_device_register_subdev(struct v4l2_device *v4l2_dev, WARN_ON(sd->v4l2_dev != NULL); if (!try_module_get(sd->owner)) return -ENODEV; + /* This just returns 0 if either of the two args is NULL */ + err = v4l2_ctrl_add_handler(v4l2_dev->ctrl_handler, sd->ctrl_handler); + if (err) + return err; sd->v4l2_dev = v4l2_dev; spin_lock(&v4l2_dev->lock); list_add_tail(&sd->list, &v4l2_dev->subdevs); |