Commit 18d171ba authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] v4l2-subdev: implement per-filehandle control handlers

To be consistent with v4l2-ioctl.c.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2d28b686
...@@ -209,6 +209,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev) ...@@ -209,6 +209,7 @@ int v4l2_device_register_subdev_nodes(struct v4l2_device *v4l2_dev)
vdev->v4l2_dev = v4l2_dev; vdev->v4l2_dev = v4l2_dev;
vdev->fops = &v4l2_subdev_fops; vdev->fops = &v4l2_subdev_fops;
vdev->release = video_device_release_empty; vdev->release = video_device_release_empty;
vdev->ctrl_handler = sd->ctrl_handler;
err = __video_register_device(vdev, VFL_TYPE_SUBDEV, -1, 1, err = __video_register_device(vdev, VFL_TYPE_SUBDEV, -1, 1,
sd->owner); sd->owner);
if (err < 0) if (err < 0)
......
...@@ -155,25 +155,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg) ...@@ -155,25 +155,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)
switch (cmd) { switch (cmd) {
case VIDIOC_QUERYCTRL: case VIDIOC_QUERYCTRL:
return v4l2_queryctrl(sd->ctrl_handler, arg); return v4l2_queryctrl(vfh->ctrl_handler, arg);
case VIDIOC_QUERYMENU: case VIDIOC_QUERYMENU:
return v4l2_querymenu(sd->ctrl_handler, arg); return v4l2_querymenu(vfh->ctrl_handler, arg);
case VIDIOC_G_CTRL: case VIDIOC_G_CTRL:
return v4l2_g_ctrl(sd->ctrl_handler, arg); return v4l2_g_ctrl(vfh->ctrl_handler, arg);
case VIDIOC_S_CTRL: case VIDIOC_S_CTRL:
return v4l2_s_ctrl(sd->ctrl_handler, arg); return v4l2_s_ctrl(vfh->ctrl_handler, arg);
case VIDIOC_G_EXT_CTRLS: case VIDIOC_G_EXT_CTRLS:
return v4l2_g_ext_ctrls(sd->ctrl_handler, arg); return v4l2_g_ext_ctrls(vfh->ctrl_handler, arg);
case VIDIOC_S_EXT_CTRLS: case VIDIOC_S_EXT_CTRLS:
return v4l2_s_ext_ctrls(sd->ctrl_handler, arg); return v4l2_s_ext_ctrls(vfh->ctrl_handler, arg);
case VIDIOC_TRY_EXT_CTRLS: case VIDIOC_TRY_EXT_CTRLS:
return v4l2_try_ext_ctrls(sd->ctrl_handler, arg); return v4l2_try_ext_ctrls(vfh->ctrl_handler, arg);
case VIDIOC_DQEVENT: case VIDIOC_DQEVENT:
if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS)) if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment