diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-04 10:46:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-26 09:48:52 -0400 |
commit | 85f5fe3962ca6780e5368feffe32f3b15e953e1f (patch) | |
tree | e3a5441ee86e62d3ca8423308f32c7a32ae68677 | |
parent | ec6f4328108f1c83d5ac907c0d978fa886ef9627 (diff) |
[media] v4l2: make vidioc_(un)subscribe_event const
Write-only ioctls should have a const argument in the ioctl op.
Do this conversion for vidioc_(un)subscribe_event.
Adding const for write-only ioctls was decided during the 2012 Media Workshop.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/pci/ivtv/ivtv-ioctl.c | 2 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/ispccdc.c | 4 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/ispstat.c | 4 | ||||
-rw-r--r-- | drivers/media/platform/omap3isp/ispstat.h | 4 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ctrls.c | 2 | ||||
-rw-r--r-- | drivers/media/v4l2-core/v4l2-event.c | 4 | ||||
-rw-r--r-- | include/media/v4l2-ctrls.h | 2 | ||||
-rw-r--r-- | include/media/v4l2-event.h | 4 | ||||
-rw-r--r-- | include/media/v4l2-ioctl.h | 4 |
9 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index d3b32c2d034e..966abb407304 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c | |||
@@ -1460,7 +1460,7 @@ static int ivtv_overlay(struct file *file, void *fh, unsigned int on) | |||
1460 | return 0; | 1460 | return 0; |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscription *sub) | 1463 | static int ivtv_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub) |
1464 | { | 1464 | { |
1465 | switch (sub->type) { | 1465 | switch (sub->type) { |
1466 | case V4L2_EVENT_VSYNC: | 1466 | case V4L2_EVENT_VSYNC: |
diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index aa9df9d71a7b..60181ab96063 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c | |||
@@ -1706,7 +1706,7 @@ static long ccdc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg) | |||
1706 | } | 1706 | } |
1707 | 1707 | ||
1708 | static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, | 1708 | static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, |
1709 | struct v4l2_event_subscription *sub) | 1709 | const struct v4l2_event_subscription *sub) |
1710 | { | 1710 | { |
1711 | if (sub->type != V4L2_EVENT_FRAME_SYNC) | 1711 | if (sub->type != V4L2_EVENT_FRAME_SYNC) |
1712 | return -EINVAL; | 1712 | return -EINVAL; |
@@ -1719,7 +1719,7 @@ static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, | |||
1719 | } | 1719 | } |
1720 | 1720 | ||
1721 | static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, | 1721 | static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh, |
1722 | struct v4l2_event_subscription *sub) | 1722 | const struct v4l2_event_subscription *sub) |
1723 | { | 1723 | { |
1724 | return v4l2_event_unsubscribe(fh, sub); | 1724 | return v4l2_event_unsubscribe(fh, sub); |
1725 | } | 1725 | } |
diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c index b8640be692f1..d7ac76b5c2ae 100644 --- a/drivers/media/platform/omap3isp/ispstat.c +++ b/drivers/media/platform/omap3isp/ispstat.c | |||
@@ -1025,7 +1025,7 @@ void omap3isp_stat_dma_isr(struct ispstat *stat) | |||
1025 | 1025 | ||
1026 | int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, | 1026 | int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, |
1027 | struct v4l2_fh *fh, | 1027 | struct v4l2_fh *fh, |
1028 | struct v4l2_event_subscription *sub) | 1028 | const struct v4l2_event_subscription *sub) |
1029 | { | 1029 | { |
1030 | struct ispstat *stat = v4l2_get_subdevdata(subdev); | 1030 | struct ispstat *stat = v4l2_get_subdevdata(subdev); |
1031 | 1031 | ||
@@ -1037,7 +1037,7 @@ int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, | |||
1037 | 1037 | ||
1038 | int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev, | 1038 | int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev, |
1039 | struct v4l2_fh *fh, | 1039 | struct v4l2_fh *fh, |
1040 | struct v4l2_event_subscription *sub) | 1040 | const struct v4l2_event_subscription *sub) |
1041 | { | 1041 | { |
1042 | return v4l2_event_unsubscribe(fh, sub); | 1042 | return v4l2_event_unsubscribe(fh, sub); |
1043 | } | 1043 | } |
diff --git a/drivers/media/platform/omap3isp/ispstat.h b/drivers/media/platform/omap3isp/ispstat.h index 9b7c8654dc8a..a6fe653eb237 100644 --- a/drivers/media/platform/omap3isp/ispstat.h +++ b/drivers/media/platform/omap3isp/ispstat.h | |||
@@ -147,10 +147,10 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name, | |||
147 | void omap3isp_stat_cleanup(struct ispstat *stat); | 147 | void omap3isp_stat_cleanup(struct ispstat *stat); |
148 | int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, | 148 | int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev, |
149 | struct v4l2_fh *fh, | 149 | struct v4l2_fh *fh, |
150 | struct v4l2_event_subscription *sub); | 150 | const struct v4l2_event_subscription *sub); |
151 | int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev, | 151 | int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev, |
152 | struct v4l2_fh *fh, | 152 | struct v4l2_fh *fh, |
153 | struct v4l2_event_subscription *sub); | 153 | const struct v4l2_event_subscription *sub); |
154 | int omap3isp_stat_s_stream(struct v4l2_subdev *subdev, int enable); | 154 | int omap3isp_stat_s_stream(struct v4l2_subdev *subdev, int enable); |
155 | 155 | ||
156 | int omap3isp_stat_busy(struct ispstat *stat); | 156 | int omap3isp_stat_busy(struct ispstat *stat); |
diff --git a/drivers/media/v4l2-core/v4l2-ctrls.c b/drivers/media/v4l2-core/v4l2-ctrls.c index ab287f236801..f40003550b60 100644 --- a/drivers/media/v4l2-core/v4l2-ctrls.c +++ b/drivers/media/v4l2-core/v4l2-ctrls.c | |||
@@ -2699,7 +2699,7 @@ int v4l2_ctrl_log_status(struct file *file, void *fh) | |||
2699 | EXPORT_SYMBOL(v4l2_ctrl_log_status); | 2699 | EXPORT_SYMBOL(v4l2_ctrl_log_status); |
2700 | 2700 | ||
2701 | int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh, | 2701 | int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh, |
2702 | struct v4l2_event_subscription *sub) | 2702 | const struct v4l2_event_subscription *sub) |
2703 | { | 2703 | { |
2704 | if (sub->type == V4L2_EVENT_CTRL) | 2704 | if (sub->type == V4L2_EVENT_CTRL) |
2705 | return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops); | 2705 | return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops); |
diff --git a/drivers/media/v4l2-core/v4l2-event.c b/drivers/media/v4l2-core/v4l2-event.c index ef2a33c94045..18a040b935a3 100644 --- a/drivers/media/v4l2-core/v4l2-event.c +++ b/drivers/media/v4l2-core/v4l2-event.c | |||
@@ -203,7 +203,7 @@ int v4l2_event_pending(struct v4l2_fh *fh) | |||
203 | EXPORT_SYMBOL_GPL(v4l2_event_pending); | 203 | EXPORT_SYMBOL_GPL(v4l2_event_pending); |
204 | 204 | ||
205 | int v4l2_event_subscribe(struct v4l2_fh *fh, | 205 | int v4l2_event_subscribe(struct v4l2_fh *fh, |
206 | struct v4l2_event_subscription *sub, unsigned elems, | 206 | const struct v4l2_event_subscription *sub, unsigned elems, |
207 | const struct v4l2_subscribed_event_ops *ops) | 207 | const struct v4l2_subscribed_event_ops *ops) |
208 | { | 208 | { |
209 | struct v4l2_subscribed_event *sev, *found_ev; | 209 | struct v4l2_subscribed_event *sev, *found_ev; |
@@ -278,7 +278,7 @@ void v4l2_event_unsubscribe_all(struct v4l2_fh *fh) | |||
278 | EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe_all); | 278 | EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe_all); |
279 | 279 | ||
280 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 280 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
281 | struct v4l2_event_subscription *sub) | 281 | const struct v4l2_event_subscription *sub) |
282 | { | 282 | { |
283 | struct v4l2_subscribed_event *sev; | 283 | struct v4l2_subscribed_event *sev; |
284 | unsigned long flags; | 284 | unsigned long flags; |
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index 7ef6b27d450f..6890f5e11ad0 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h | |||
@@ -546,7 +546,7 @@ int v4l2_ctrl_log_status(struct file *file, void *fh); | |||
546 | /* Can be used as a vidioc_subscribe_event function that just subscribes | 546 | /* Can be used as a vidioc_subscribe_event function that just subscribes |
547 | control events. */ | 547 | control events. */ |
548 | int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh, | 548 | int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh, |
549 | struct v4l2_event_subscription *sub); | 549 | const struct v4l2_event_subscription *sub); |
550 | 550 | ||
551 | /* Can be used as a poll function that just polls for control events. */ | 551 | /* Can be used as a poll function that just polls for control events. */ |
552 | unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait); | 552 | unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait); |
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h index 2885a810a128..e7c5d170a9cd 100644 --- a/include/media/v4l2-event.h +++ b/include/media/v4l2-event.h | |||
@@ -124,10 +124,10 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); | |||
124 | void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); | 124 | void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev); |
125 | int v4l2_event_pending(struct v4l2_fh *fh); | 125 | int v4l2_event_pending(struct v4l2_fh *fh); |
126 | int v4l2_event_subscribe(struct v4l2_fh *fh, | 126 | int v4l2_event_subscribe(struct v4l2_fh *fh, |
127 | struct v4l2_event_subscription *sub, unsigned elems, | 127 | const struct v4l2_event_subscription *sub, unsigned elems, |
128 | const struct v4l2_subscribed_event_ops *ops); | 128 | const struct v4l2_subscribed_event_ops *ops); |
129 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, | 129 | int v4l2_event_unsubscribe(struct v4l2_fh *fh, |
130 | struct v4l2_event_subscription *sub); | 130 | const struct v4l2_event_subscription *sub); |
131 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); | 131 | void v4l2_event_unsubscribe_all(struct v4l2_fh *fh); |
132 | 132 | ||
133 | #endif /* V4L2_EVENT_H */ | 133 | #endif /* V4L2_EVENT_H */ |
diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 865f95d92ba8..3eef4de0ca33 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h | |||
@@ -273,9 +273,9 @@ struct v4l2_ioctl_ops { | |||
273 | struct v4l2_dv_timings_cap *cap); | 273 | struct v4l2_dv_timings_cap *cap); |
274 | 274 | ||
275 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, | 275 | int (*vidioc_subscribe_event) (struct v4l2_fh *fh, |
276 | struct v4l2_event_subscription *sub); | 276 | const struct v4l2_event_subscription *sub); |
277 | int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, | 277 | int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, |
278 | struct v4l2_event_subscription *sub); | 278 | const struct v4l2_event_subscription *sub); |
279 | 279 | ||
280 | /* For other private ioctls */ | 280 | /* For other private ioctls */ |
281 | long (*vidioc_default) (struct file *file, void *fh, | 281 | long (*vidioc_default) (struct file *file, void *fh, |