[media] v4l2-subdev: fix broken subdev control enumeration

The v4l2_subdev_* functions are meant for older V4L2 drivers that do not use
the control framework yet. These functions should not be used by subdev_do_ioctl.

Most of those backwards compatibility functions are just stubs, but commit
87a0c94ce6 actually changed the behavior of
v4l2_subdev_queryctrl, so calling that one from subdev_do_ioctl broke the
control enumeration in subdev nodes.

The fix is simply not to use those compatibility functions in v4l2-subdev.c.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Hans Verkuil 2011-05-02 08:09:25 -03:00 committed by Mauro Carvalho Chehab
parent 2a164d02dd
commit 0b84834a5a
1 changed files with 7 additions and 7 deletions

View File

@ -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_subdev_queryctrl(sd, arg); return v4l2_queryctrl(sd->ctrl_handler, arg);
case VIDIOC_QUERYMENU: case VIDIOC_QUERYMENU:
return v4l2_subdev_querymenu(sd, arg); return v4l2_querymenu(sd->ctrl_handler, arg);
case VIDIOC_G_CTRL: case VIDIOC_G_CTRL:
return v4l2_subdev_g_ctrl(sd, arg); return v4l2_g_ctrl(sd->ctrl_handler, arg);
case VIDIOC_S_CTRL: case VIDIOC_S_CTRL:
return v4l2_subdev_s_ctrl(sd, arg); return v4l2_s_ctrl(sd->ctrl_handler, arg);
case VIDIOC_G_EXT_CTRLS: case VIDIOC_G_EXT_CTRLS:
return v4l2_subdev_g_ext_ctrls(sd, arg); return v4l2_g_ext_ctrls(sd->ctrl_handler, arg);
case VIDIOC_S_EXT_CTRLS: case VIDIOC_S_EXT_CTRLS:
return v4l2_subdev_s_ext_ctrls(sd, arg); return v4l2_s_ext_ctrls(sd->ctrl_handler, arg);
case VIDIOC_TRY_EXT_CTRLS: case VIDIOC_TRY_EXT_CTRLS:
return v4l2_subdev_try_ext_ctrls(sd, arg); return v4l2_try_ext_ctrls(sd->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))