diff options
author | Ramakrishnan Muthukrishnan <ramakrmu@cisco.com> | 2014-06-19 13:22:57 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-07-04 15:14:22 -0400 |
commit | b7284bb0be49441805ae7db0fc419ab7ee882bff (patch) | |
tree | 6d30d79d1a4ee6510a67e86d630992147e289f43 | |
parent | c41ad9c38ef36545563dd55345879fe5f867aa19 (diff) |
[media] media: v4l2-core: remove the use of V4L2_FL_USE_FH_PRIO flag
Since all the drivers that use `struct v4l2_fh' use the core priority
checking instead of doing it themselves, this flag can be removed.
This patch removes the usage of the flag from v4l2-core.
Signed-off-by: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com>
Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-dev.c | 6 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-fh.c | 13 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ioctl.c | 9 |
3 files changed, 14 insertions, 14 deletions
diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 634d863c05b4..35698aa377f5 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c | |||
@@ -563,11 +563,9 @@ static void determine_valid_ioctls(struct video_device *vdev) | |||
563 | /* vfl_type and vfl_dir independent ioctls */ | 563 | /* vfl_type and vfl_dir independent ioctls */ |
564 | 564 | ||
565 | SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); | 565 | SET_VALID_IOCTL(ops, VIDIOC_QUERYCAP, vidioc_querycap); |
566 | if (ops->vidioc_g_priority || | 566 | if (ops->vidioc_g_priority) |
567 | test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags)) | ||
568 | set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); | 567 | set_bit(_IOC_NR(VIDIOC_G_PRIORITY), valid_ioctls); |
569 | if (ops->vidioc_s_priority || | 568 | if (ops->vidioc_s_priority) |
570 | test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags)) | ||
571 | set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); | 569 | set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls); |
572 | SET_VALID_IOCTL(ops, VIDIOC_STREAMON, vidioc_streamon); | 570 | SET_VALID_IOCTL(ops, VIDIOC_STREAMON, vidioc_streamon); |
573 | SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff); | 571 | SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff); |
diff --git a/drivers/media/v4l2-core/v4l2-fh.c b/drivers/media/v4l2-core/v4l2-fh.c index e57c002b4150..c97067a25bd2 100644 --- a/drivers/media/v4l2-core/v4l2-fh.c +++ b/drivers/media/v4l2-core/v4l2-fh.c | |||
@@ -37,6 +37,13 @@ void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev) | |||
37 | fh->ctrl_handler = vdev->ctrl_handler; | 37 | fh->ctrl_handler = vdev->ctrl_handler; |
38 | INIT_LIST_HEAD(&fh->list); | 38 | INIT_LIST_HEAD(&fh->list); |
39 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); | 39 | set_bit(V4L2_FL_USES_V4L2_FH, &fh->vdev->flags); |
40 | /* | ||
41 | * determine_valid_ioctls() does not know if struct v4l2_fh | ||
42 | * is used by this driver, but here we do. So enable the | ||
43 | * prio ioctls here. | ||
44 | */ | ||
45 | set_bit(_IOC_NR(VIDIOC_G_PRIORITY), vdev->valid_ioctls); | ||
46 | set_bit(_IOC_NR(VIDIOC_S_PRIORITY), vdev->valid_ioctls); | ||
40 | fh->prio = V4L2_PRIORITY_UNSET; | 47 | fh->prio = V4L2_PRIORITY_UNSET; |
41 | init_waitqueue_head(&fh->wait); | 48 | init_waitqueue_head(&fh->wait); |
42 | INIT_LIST_HEAD(&fh->available); | 49 | INIT_LIST_HEAD(&fh->available); |
@@ -49,8 +56,7 @@ void v4l2_fh_add(struct v4l2_fh *fh) | |||
49 | { | 56 | { |
50 | unsigned long flags; | 57 | unsigned long flags; |
51 | 58 | ||
52 | if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) | 59 | v4l2_prio_open(fh->vdev->prio, &fh->prio); |
53 | v4l2_prio_open(fh->vdev->prio, &fh->prio); | ||
54 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 60 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
55 | list_add(&fh->list, &fh->vdev->fh_list); | 61 | list_add(&fh->list, &fh->vdev->fh_list); |
56 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 62 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
@@ -78,8 +84,7 @@ void v4l2_fh_del(struct v4l2_fh *fh) | |||
78 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); | 84 | spin_lock_irqsave(&fh->vdev->fh_lock, flags); |
79 | list_del_init(&fh->list); | 85 | list_del_init(&fh->list); |
80 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); | 86 | spin_unlock_irqrestore(&fh->vdev->fh_lock, flags); |
81 | if (test_bit(V4L2_FL_USE_FH_PRIO, &fh->vdev->flags)) | 87 | v4l2_prio_close(fh->vdev->prio, fh->prio); |
82 | v4l2_prio_close(fh->vdev->prio, fh->prio); | ||
83 | } | 88 | } |
84 | EXPORT_SYMBOL_GPL(v4l2_fh_del); | 89 | EXPORT_SYMBOL_GPL(v4l2_fh_del); |
85 | 90 | ||
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 16bffd851bf9..8d4a25d62e47 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
@@ -2190,7 +2190,6 @@ static long __video_do_ioctl(struct file *file, | |||
2190 | const struct v4l2_ioctl_info *info; | 2190 | const struct v4l2_ioctl_info *info; |
2191 | void *fh = file->private_data; | 2191 | void *fh = file->private_data; |
2192 | struct v4l2_fh *vfh = NULL; | 2192 | struct v4l2_fh *vfh = NULL; |
2193 | int use_fh_prio = 0; | ||
2194 | int debug = vfd->debug; | 2193 | int debug = vfd->debug; |
2195 | long ret = -ENOTTY; | 2194 | long ret = -ENOTTY; |
2196 | 2195 | ||
@@ -2200,10 +2199,8 @@ static long __video_do_ioctl(struct file *file, | |||
2200 | return ret; | 2199 | return ret; |
2201 | } | 2200 | } |
2202 | 2201 | ||
2203 | if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) { | 2202 | if (test_bit(V4L2_FL_USES_V4L2_FH, &vfd->flags)) |
2204 | vfh = file->private_data; | 2203 | vfh = file->private_data; |
2205 | use_fh_prio = test_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags); | ||
2206 | } | ||
2207 | 2204 | ||
2208 | if (v4l2_is_known_ioctl(cmd)) { | 2205 | if (v4l2_is_known_ioctl(cmd)) { |
2209 | info = &v4l2_ioctls[_IOC_NR(cmd)]; | 2206 | info = &v4l2_ioctls[_IOC_NR(cmd)]; |
@@ -2212,7 +2209,7 @@ static long __video_do_ioctl(struct file *file, | |||
2212 | !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler)) | 2209 | !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler)) |
2213 | goto done; | 2210 | goto done; |
2214 | 2211 | ||
2215 | if (use_fh_prio && (info->flags & INFO_FL_PRIO)) { | 2212 | if (vfh && (info->flags & INFO_FL_PRIO)) { |
2216 | ret = v4l2_prio_check(vfd->prio, vfh->prio); | 2213 | ret = v4l2_prio_check(vfd->prio, vfh->prio); |
2217 | if (ret) | 2214 | if (ret) |
2218 | goto done; | 2215 | goto done; |
@@ -2237,7 +2234,7 @@ static long __video_do_ioctl(struct file *file, | |||
2237 | ret = -ENOTTY; | 2234 | ret = -ENOTTY; |
2238 | } else { | 2235 | } else { |
2239 | ret = ops->vidioc_default(file, fh, | 2236 | ret = ops->vidioc_default(file, fh, |
2240 | use_fh_prio ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0, | 2237 | vfh ? v4l2_prio_check(vfd->prio, vfh->prio) >= 0 : 0, |
2241 | cmd, arg); | 2238 | cmd, arg); |
2242 | } | 2239 | } |
2243 | 2240 | ||