diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-07-19 07:49:25 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-07-30 18:20:44 -0400 |
commit | 837c7e4256d5285700fe0d500eeb15801b55bb0e (patch) | |
tree | 1707fa8ce2bdf35e08d4b9d850ded84ae1a3f91f /drivers/media | |
parent | 47556ffaf212273ca65ce2d3177d4ff2f116db4d (diff) |
[media] v4l2-dev: G_PARM was incorrectly enabled for all video nodes
G_PARM should only be enabled if:
- vidioc_g_parm is present
- or: it is a video node and vidioc_g_std or tvnorms are set.
Without this additional check v4l2-compliance would complain about
being able to use g_parm when it didn't expect it.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index af70f931727c..1b2f1c52e6c3 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -697,7 +697,8 @@ static void determine_valid_ioctls(struct video_device *vdev) | |||
697 | SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd); | 697 | SET_VALID_IOCTL(ops, VIDIOC_TRY_ENCODER_CMD, vidioc_try_encoder_cmd); |
698 | SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd); | 698 | SET_VALID_IOCTL(ops, VIDIOC_DECODER_CMD, vidioc_decoder_cmd); |
699 | SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd); | 699 | SET_VALID_IOCTL(ops, VIDIOC_TRY_DECODER_CMD, vidioc_try_decoder_cmd); |
700 | if (ops->vidioc_g_parm || vdev->vfl_type == VFL_TYPE_GRABBER) | 700 | if (ops->vidioc_g_parm || (vdev->vfl_type == VFL_TYPE_GRABBER && |
701 | (ops->vidioc_g_std || vdev->tvnorms))) | ||
701 | set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls); | 702 | set_bit(_IOC_NR(VIDIOC_G_PARM), valid_ioctls); |
702 | SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm); | 703 | SET_VALID_IOCTL(ops, VIDIOC_S_PARM, vidioc_s_parm); |
703 | SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner); | 704 | SET_VALID_IOCTL(ops, VIDIOC_G_TUNER, vidioc_g_tuner); |