Skip to content

Commit

Permalink
[media] v4l2-subdev: fix broken subdev control enumeration
Browse files Browse the repository at this point in the history
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
87a0c94 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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed May 4, 2011
1 parent 2a164d0 commit 0b84834
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/media/video/v4l2-subdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,25 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg)

switch (cmd) {
case VIDIOC_QUERYCTRL:
return v4l2_subdev_queryctrl(sd, arg);
return v4l2_queryctrl(sd->ctrl_handler, arg);

case VIDIOC_QUERYMENU:
return v4l2_subdev_querymenu(sd, arg);
return v4l2_querymenu(sd->ctrl_handler, arg);

case VIDIOC_G_CTRL:
return v4l2_subdev_g_ctrl(sd, arg);
return v4l2_g_ctrl(sd->ctrl_handler, arg);

case VIDIOC_S_CTRL:
return v4l2_subdev_s_ctrl(sd, arg);
return v4l2_s_ctrl(sd->ctrl_handler, arg);

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:
return v4l2_subdev_s_ext_ctrls(sd, arg);
return v4l2_s_ext_ctrls(sd->ctrl_handler, arg);

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:
if (!(sd->flags & V4L2_SUBDEV_FL_HAS_EVENTS))
Expand Down

0 comments on commit 0b84834

Please sign in to comment.