[media] v4l2: make vidioc_(un)subscribe_event const
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 4 Sep 2012 14:46:09 +0000 (11:46 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 13:48:52 +0000 (10:48 -0300)
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>
drivers/media/pci/ivtv/ivtv-ioctl.c
drivers/media/platform/omap3isp/ispccdc.c
drivers/media/platform/omap3isp/ispstat.c
drivers/media/platform/omap3isp/ispstat.h
drivers/media/v4l2-core/v4l2-ctrls.c
drivers/media/v4l2-core/v4l2-event.c
include/media/v4l2-ctrls.h
include/media/v4l2-event.h
include/media/v4l2-ioctl.h

index d3b32c2d034e70a9c2b1203b52cfd703dee544e5..966abb4073041f8a1ad45086a6ace0db055f7710 100644 (file)
@@ -1460,7 +1460,7 @@ static int ivtv_overlay(struct file *file, void *fh, unsigned int on)
        return 0;
 }
 
-static int ivtv_subscribe_event(struct v4l2_fh *fh, struct v4l2_event_subscription *sub)
+static int ivtv_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub)
 {
        switch (sub->type) {
        case V4L2_EVENT_VSYNC:
index aa9df9d71a7b0a455544446ed3e79e7c83ac7218..60181ab96063ea12be4f0a10f6b02e5a86e29991 100644 (file)
@@ -1706,7 +1706,7 @@ static long ccdc_ioctl(struct v4l2_subdev *sd, unsigned int cmd, void *arg)
 }
 
 static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
-                               struct v4l2_event_subscription *sub)
+                               const struct v4l2_event_subscription *sub)
 {
        if (sub->type != V4L2_EVENT_FRAME_SYNC)
                return -EINVAL;
@@ -1719,7 +1719,7 @@ static int ccdc_subscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
 }
 
 static int ccdc_unsubscribe_event(struct v4l2_subdev *sd, struct v4l2_fh *fh,
-                                 struct v4l2_event_subscription *sub)
+                                 const struct v4l2_event_subscription *sub)
 {
        return v4l2_event_unsubscribe(fh, sub);
 }
index b8640be692f1aef7f093b6364ddb62c15a881504..d7ac76b5c2aee4d38916057b1757d2366b27b188 100644 (file)
@@ -1025,7 +1025,7 @@ void omap3isp_stat_dma_isr(struct ispstat *stat)
 
 int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
                                  struct v4l2_fh *fh,
-                                 struct v4l2_event_subscription *sub)
+                                 const struct v4l2_event_subscription *sub)
 {
        struct ispstat *stat = v4l2_get_subdevdata(subdev);
 
@@ -1037,7 +1037,7 @@ int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
 
 int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
                                    struct v4l2_fh *fh,
-                                   struct v4l2_event_subscription *sub)
+                                   const struct v4l2_event_subscription *sub)
 {
        return v4l2_event_unsubscribe(fh, sub);
 }
index 9b7c8654dc8a4cadea05dd1ff629ad35b8ebae85..a6fe653eb237dc171c6aef71f31d62ddc1a30550 100644 (file)
@@ -147,10 +147,10 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name,
 void omap3isp_stat_cleanup(struct ispstat *stat);
 int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
                                  struct v4l2_fh *fh,
-                                 struct v4l2_event_subscription *sub);
+                                 const struct v4l2_event_subscription *sub);
 int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
                                    struct v4l2_fh *fh,
-                                   struct v4l2_event_subscription *sub);
+                                   const struct v4l2_event_subscription *sub);
 int omap3isp_stat_s_stream(struct v4l2_subdev *subdev, int enable);
 
 int omap3isp_stat_busy(struct ispstat *stat);
index ab287f2368014fe8cf045a3a0c33ca840dd8e916..f40003550b609303e6fd8590cd1df2d5dd82ecee 100644 (file)
@@ -2699,7 +2699,7 @@ int v4l2_ctrl_log_status(struct file *file, void *fh)
 EXPORT_SYMBOL(v4l2_ctrl_log_status);
 
 int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
-                               struct v4l2_event_subscription *sub)
+                               const struct v4l2_event_subscription *sub)
 {
        if (sub->type == V4L2_EVENT_CTRL)
                return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
index ef2a33c9404559a4d4e0f80c23de45c10e8baf0a..18a040b935a312d31abb944c50405e026a510f1b 100644 (file)
@@ -203,7 +203,7 @@ int v4l2_event_pending(struct v4l2_fh *fh)
 EXPORT_SYMBOL_GPL(v4l2_event_pending);
 
 int v4l2_event_subscribe(struct v4l2_fh *fh,
-                        struct v4l2_event_subscription *sub, unsigned elems,
+                        const struct v4l2_event_subscription *sub, unsigned elems,
                         const struct v4l2_subscribed_event_ops *ops)
 {
        struct v4l2_subscribed_event *sev, *found_ev;
@@ -278,7 +278,7 @@ void v4l2_event_unsubscribe_all(struct v4l2_fh *fh)
 EXPORT_SYMBOL_GPL(v4l2_event_unsubscribe_all);
 
 int v4l2_event_unsubscribe(struct v4l2_fh *fh,
-                          struct v4l2_event_subscription *sub)
+                          const struct v4l2_event_subscription *sub)
 {
        struct v4l2_subscribed_event *sev;
        unsigned long flags;
index 7ef6b27d450fcb2f6674b0d902e2a87cfaae21a0..6890f5e11ad0587fbdd9f878c6f303a6124aefa6 100644 (file)
@@ -546,7 +546,7 @@ int v4l2_ctrl_log_status(struct file *file, void *fh);
 /* Can be used as a vidioc_subscribe_event function that just subscribes
    control events. */
 int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
-                               struct v4l2_event_subscription *sub);
+                               const struct v4l2_event_subscription *sub);
 
 /* Can be used as a poll function that just polls for control events. */
 unsigned int v4l2_ctrl_poll(struct file *file, struct poll_table_struct *wait);
index 2885a810a128512afba7bb42803a75ff2203585a..e7c5d170a9cd48c42ae8876d279c1be1dd0479ec 100644 (file)
@@ -124,10 +124,10 @@ void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev);
 void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev);
 int v4l2_event_pending(struct v4l2_fh *fh);
 int v4l2_event_subscribe(struct v4l2_fh *fh,
-                        struct v4l2_event_subscription *sub, unsigned elems,
+                        const struct v4l2_event_subscription *sub, unsigned elems,
                         const struct v4l2_subscribed_event_ops *ops);
 int v4l2_event_unsubscribe(struct v4l2_fh *fh,
-                          struct v4l2_event_subscription *sub);
+                          const struct v4l2_event_subscription *sub);
 void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
 
 #endif /* V4L2_EVENT_H */
index 865f95d92ba8fac15cb11bdce4456bcce39030aa..3eef4de0ca33db2f77c6dd397e0b7ca649e56c23 100644 (file)
@@ -273,9 +273,9 @@ struct v4l2_ioctl_ops {
                                    struct v4l2_dv_timings_cap *cap);
 
        int (*vidioc_subscribe_event)  (struct v4l2_fh *fh,
-                                       struct v4l2_event_subscription *sub);
+                                       const struct v4l2_event_subscription *sub);
        int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh,
-                                       struct v4l2_event_subscription *sub);
+                                       const struct v4l2_event_subscription *sub);
 
        /* For other private ioctls */
        long (*vidioc_default)         (struct file *file, void *fh,