Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85f5fe39 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent ec6f4328
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1460,7 +1460,7 @@ static int ivtv_overlay(struct file *file, void *fh, unsigned int on)
	return 0;
	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) {
	switch (sub->type) {
	case V4L2_EVENT_VSYNC:
	case V4L2_EVENT_VSYNC:
+2 −2
Original line number Original line Diff line number Diff line
@@ -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,
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)
	if (sub->type != V4L2_EVENT_FRAME_SYNC)
		return -EINVAL;
		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,
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);
	return v4l2_event_unsubscribe(fh, sub);
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -1025,7 +1025,7 @@ void omap3isp_stat_dma_isr(struct ispstat *stat)


int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
				  struct v4l2_fh *fh,
				  struct v4l2_fh *fh,
				  struct v4l2_event_subscription *sub)
				  const struct v4l2_event_subscription *sub)
{
{
	struct ispstat *stat = v4l2_get_subdevdata(subdev);
	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,
int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
				    struct v4l2_fh *fh,
				    struct v4l2_fh *fh,
				    struct v4l2_event_subscription *sub)
				    const struct v4l2_event_subscription *sub)
{
{
	return v4l2_event_unsubscribe(fh, sub);
	return v4l2_event_unsubscribe(fh, sub);
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -147,10 +147,10 @@ int omap3isp_stat_init(struct ispstat *stat, const char *name,
void omap3isp_stat_cleanup(struct ispstat *stat);
void omap3isp_stat_cleanup(struct ispstat *stat);
int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
int omap3isp_stat_subscribe_event(struct v4l2_subdev *subdev,
				  struct v4l2_fh *fh,
				  struct v4l2_fh *fh,
				  struct v4l2_event_subscription *sub);
				  const struct v4l2_event_subscription *sub);
int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
int omap3isp_stat_unsubscribe_event(struct v4l2_subdev *subdev,
				    struct v4l2_fh *fh,
				    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_s_stream(struct v4l2_subdev *subdev, int enable);


int omap3isp_stat_busy(struct ispstat *stat);
int omap3isp_stat_busy(struct ispstat *stat);
+1 −1
Original line number Original line Diff line number Diff line
@@ -2699,7 +2699,7 @@ int v4l2_ctrl_log_status(struct file *file, void *fh)
EXPORT_SYMBOL(v4l2_ctrl_log_status);
EXPORT_SYMBOL(v4l2_ctrl_log_status);


int v4l2_ctrl_subscribe_event(struct v4l2_fh *fh,
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)
	if (sub->type == V4L2_EVENT_CTRL)
		return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
		return v4l2_event_subscribe(fh, sub, 0, &v4l2_ctrl_sub_ev_ops);
Loading