Commit 2438e78a authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent cee05cb3
...@@ -532,10 +532,9 @@ static void determine_valid_ioctls(struct video_device *vdev) ...@@ -532,10 +532,9 @@ static void determine_valid_ioctls(struct video_device *vdev)
/* vfl_type and vfl_dir independent ioctls */ /* vfl_type and vfl_dir independent ioctls */
SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap);
if (ops->vidioc_g_priority) set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls);
set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls);
if (ops->vidioc_s_priority)
set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls);
/* Note: the control handler can also be passed through the filehandle, /* Note: the control handler can also be passed through the filehandle,
and that can't be tested here. If the bit for these control ioctls and that can't be tested here. If the bit for these control ioctls
is set, then the ioctl is valid. But if it is 0, then it can still is set, then the ioctl is valid. But if it is 0, then it can still
......
...@@ -1046,8 +1046,6 @@ static int v4l_g_priority(const struct v4l2_ioctl_ops *ops, ...@@ -1046,8 +1046,6 @@ static int v4l_g_priority(const struct v4l2_ioctl_ops *ops,
struct video_device *vfd; struct video_device *vfd;
u32 *p = arg; u32 *p = arg;
if (ops->vidioc_g_priority)
return ops->vidioc_g_priority(file, fh, arg);
vfd = video_devdata(file); vfd = video_devdata(file);
*p = v4l2_prio_max(vfd->prio); *p = v4l2_prio_max(vfd->prio);
return 0; return 0;
...@@ -1060,9 +1058,9 @@ static int v4l_s_priority(const struct v4l2_ioctl_ops *ops, ...@@ -1060,9 +1058,9 @@ static int v4l_s_priority(const struct v4l2_ioctl_ops *ops,
struct v4l2_fh *vfh; struct v4l2_fh *vfh;
u32 *p = arg; u32 *p = arg;
if (ops->vidioc_s_priority)
return ops->vidioc_s_priority(file, fh, *p);
vfd = video_devdata(file); vfd = video_devdata(file);
if (!test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags))
return -ENOTTY;
vfh = file->private_data; vfh = file->private_data;
return v4l2_prio_change(vfd->prio, &vfh->prio, *p); return v4l2_prio_change(vfd->prio, &vfh->prio, *p);
} }
......
...@@ -23,12 +23,6 @@ struct v4l2_ioctl_ops { ...@@ -23,12 +23,6 @@ struct v4l2_ioctl_ops {
/* VIDIOC_QUERYCAP handler */ /* VIDIOC_QUERYCAP handler */
int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap); int (*vidioc_querycap)(struct file *file, void *fh, struct v4l2_capability *cap);
/* Priority handling */
int (*vidioc_g_priority) (struct file *file, void *fh,
enum v4l2_priority *p);
int (*vidioc_s_priority) (struct file *file, void *fh,
enum v4l2_priority p);
/* VIDIOC_ENUM_FMT handlers */ /* VIDIOC_ENUM_FMT handlers */
int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh, int (*vidioc_enum_fmt_vid_cap) (struct file *file, void *fh,
struct v4l2_fmtdesc *f); struct v4l2_fmtdesc *f);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment