diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-02-03 08:46:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-03-02 15:09:43 -0500 |
commit | 2438e78a48643d41defd4b90da19d17b9c3e65f3 (patch) | |
tree | 95f779d062caa6c2f9aaf54a1b8019c094be8058 /drivers/media | |
parent | cee05cb3598813f05a3419c56487e337ee84210f (diff) |
[media] v4l2-core: drop g/s_priority ops
The handling of VIDIOC_G/S_PRIORITY is now entirely done by the V4L2
core, so we can drop the g/s_priority ioctl ops.
We do have to make sure though that when S_PRIORITY is called we check
that the driver used struct v4l2_fh. This check can be removed once all
drivers are converted to that structure.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dev.c | 7 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ioctl.c | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 9f4538ce09c2..e2b8b3ed6ef3 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c | |||
@@ -532,10 +532,9 @@ static void determine_valid_ioctls(struct video_device *vdev) | |||
532 | /* vfl_type and vfl_dir independent ioctls */ | 532 | /* vfl_type and vfl_dir independent ioctls */ |
533 | 533 | ||
534 | SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); | 534 | SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); |
535 | if (ops->vidioc_g_priority) | 535 | set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); |
536 | set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); | 536 | set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); |
537 | if (ops->vidioc_s_priority) | 537 | |
538 | set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); | ||
539 | /* Note: the control handler can also be passed through the filehandle, | 538 | /* Note: the control handler can also be passed through the filehandle, |
540 | and that can't be tested here. If the bit for these control ioctls | 539 | and that can't be tested here. If the bit for these control ioctls |
541 | is set, then the ioctl is valid. But if it is 0, then it can still | 540 | is set, then the ioctl is valid. But if it is 0, then it can still |
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index b08407225db1..09ad8ddfaaf9 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
@@ -1046,8 +1046,6 @@ static int v4l_g_priority(const struct v4l2_ioctl_ops *ops, | |||
1046 | struct video_device *vfd; | 1046 | struct video_device *vfd; |
1047 | u32 *p = arg; | 1047 | u32 *p = arg; |
1048 | 1048 | ||
1049 | if (ops->vidioc_g_priority) | ||
1050 | return ops->vidioc_g_priority(file, fh, arg); | ||
1051 | vfd = video_devdata(file); | 1049 | vfd = video_devdata(file); |
1052 | *p = v4l2_prio_max(vfd->prio); | 1050 | *p = v4l2_prio_max(vfd->prio); |
1053 | return 0; | 1051 | return 0; |
@@ -1060,9 +1058,9 @@ static int v4l_s_priority(const struct v4l2_ioctl_ops *ops, | |||
1060 | struct v4l2_fh *vfh; | 1058 | struct v4l2_fh *vfh; |
1061 | u32 *p = arg; | 1059 | u32 *p = arg; |
1062 | 1060 | ||
1063 | if (ops->vidioc_s_priority) | ||
1064 | return ops->vidioc_s_priority(file, fh, *p); | ||
1065 | vfd = video_devdata(file); | 1061 | vfd = video_devdata(file); |
1062 | if (!test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) | ||
1063 | return -ENOTTY; | ||
1066 | vfh = file->private_data; | 1064 | vfh = file->private_data; |
1067 | return v4l2_prio_change(vfd->prio, &vfh->prio, *p); | 1065 | return v4l2_prio_change(vfd->prio, &vfh->prio, *p); |
1068 | } | 1066 | } |