Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
2438e78a cee05cb3

+5 -14
+3 -4
drivers/media/v4l2-core/v4l2-dev.c
··· 532 532 /* vfl_type and vfl_dir independent ioctls */ 533 533 534 534 SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); 535 - if (ops->vidioc_g_priority) 536 - set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); 537 - if (ops->vidioc_s_priority) 538 - set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); 535 + set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); 536 + set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); 537 + 539 538 /* Note: the control handler can also be passed through the filehandle, 540 539 and that can't be tested here. If the bit for these control ioctls 541 540 is set, then the ioctl is valid. But if it is 0, then it can still
+2 -4
drivers/media/v4l2-core/v4l2-ioctl.c
··· 1046 1046 struct video_device *vfd; 1047 1047 u32 *p = arg; 1048 1048 1049 - if (ops->vidioc_g_priority) 1050 - return ops->vidioc_g_priority(file, fh, arg); 1051 1049 vfd = video_devdata(file); 1052 1050 *p = v4l2_prio_max(vfd->prio); 1053 1051 return 0; ··· 1058 1060 struct v4l2_fh *vfh; 1059 1061 u32 *p = arg; 1060 1062 1061 - if (ops->vidioc_s_priority) 1062 - return ops->vidioc_s_priority(file, fh, *p); 1063 1063 vfd = video_devdata(file); 1064 + if (!test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) 1065 + return -ENOTTY; 1064 1066 vfh = file->private_data; 1065 1067 return v4l2_prio_change(vfd->prio, &vfh->prio, *p); 1066 1068 }
-6
include/media/v4l2-ioctl.h
··· 23 23 /* VIDIOC_QUERYCAP handler */ 24 24 int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); 25 25 26 - /* Priority handling */ 27 - int (*vidioc_g_priority) (struct file *file, void *fh, 28 - enum v4l2_priority *p); 29 - int (*vidioc_s_priority) (struct file *file, void *fh, 30 - enum v4l2_priority p); 31 - 32 26 /* VIDIOC_ENUM_FMT handlers */ 33 27 int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, 34 28 struct v4l2_fmtdesc *f);