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

Commit 314527ac authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] v4l2: pass std by value to the write-only s_std ioctl



This ioctl is defined as IOW, so pass the argument by value instead of by
reference. I could have chosen to add const instead, but this is 1) easier
to handle in drivers and 2) consistent with the s_std subdev operation.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarJonathan Corbet <corbet@lwn.net>
Acked-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2f73c7c5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -832,7 +832,7 @@ static int vidioc_g_std(struct file *file, void *fh, v4l2_std_id *norm)
	}
	*/

static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id)
{
	struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
	struct saa7146_vv *vv = dev->vv_data;
@@ -856,7 +856,7 @@ static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id *id)
	}

	for (i = 0; i < dev->ext_vv_data->num_stds; i++)
		if (*id & dev->ext_vv_data->stds[i].id)
		if (id & dev->ext_vv_data->stds[i].id)
			break;
	if (i != dev->ext_vv_data->num_stds) {
		vv->standard = &dev->ext_vv_data->stds[i];
+2 −2
Original line number Diff line number Diff line
@@ -735,12 +735,12 @@ static int pms_g_std(struct file *file, void *fh, v4l2_std_id *std)
	return 0;
}

static int pms_s_std(struct file *file, void *fh, v4l2_std_id *std)
static int pms_s_std(struct file *file, void *fh, v4l2_std_id std)
{
	struct pms *dev = video_drvdata(file);
	int ret = 0;

	dev->std = *std;
	dev->std = std;
	if (dev->std & V4L2_STD_NTSC) {
		pms_framerate(dev, 30);
		pms_secamcross(dev, 0);
+3 −3
Original line number Diff line number Diff line
@@ -1713,7 +1713,7 @@ static void radio_enable(struct bttv *btv)
	}
}

static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
static int bttv_s_std(struct file *file, void *priv, v4l2_std_id id)
{
	struct bttv_fh *fh  = priv;
	struct bttv *btv = fh->btv;
@@ -1721,14 +1721,14 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
	int err = 0;

	for (i = 0; i < BTTV_TVNORMS; i++)
		if (*id & bttv_tvnorms[i].v4l2_id)
		if (id & bttv_tvnorms[i].v4l2_id)
			break;
	if (i == BTTV_TVNORMS) {
		err = -EINVAL;
		goto err;
	}

	btv->std = *id;
	btv->std = id;
	set_tvnorm(btv, i);

err:
+1 −1
Original line number Diff line number Diff line
@@ -1243,7 +1243,7 @@ int cx18_init_on_first_open(struct cx18 *cx)
	   in one place. */
	cx->std++;		/* Force full standard initialization */
	std = (cx->tuner_std == V4L2_STD_ALL) ? V4L2_STD_NTSC_M : cx->tuner_std;
	cx18_s_std(NULL, &fh, &std);
	cx18_s_std(NULL, &fh, std);
	cx18_s_frequency(NULL, &fh, &vf);
	return 0;
}
+5 −5
Original line number Diff line number Diff line
@@ -637,15 +637,15 @@ static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std)
	return 0;
}

int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
int cx18_s_std(struct file *file, void *fh, v4l2_std_id std)
{
	struct cx18_open_id *id = fh2id(fh);
	struct cx18 *cx = id->cx;

	if ((*std & V4L2_STD_ALL) == 0)
	if ((std & V4L2_STD_ALL) == 0)
		return -EINVAL;

	if (*std == cx->std)
	if (std == cx->std)
		return 0;

	if (test_bit(CX18_F_I_RADIO_USER, &cx->i_flags) ||
@@ -656,8 +656,8 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
		return -EBUSY;
	}

	cx->std = *std;
	cx->is_60hz = (*std & V4L2_STD_525_60) ? 1 : 0;
	cx->std = std;
	cx->is_60hz = (std & V4L2_STD_525_60) ? 1 : 0;
	cx->is_50hz = !cx->is_60hz;
	cx2341x_handler_set_50hz(&cx->cxhdl, cx->is_50hz);
	cx->cxhdl.width = 720;
Loading