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

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

V4L/DVB: v4l2-common: simplify prio utility functions



v4l2_prio_init/open/close returned an int when in fact they would
always return 0. Make these void functions.

v4l2_prio_close and v4l2_prio_check pass an enum v4l2_priority as a
pointer for no good reason. Replace with a normal enum v4l2_priority
argument.

These changes will simplify the work of moving priority handling into
the v4l core.

Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 530d2d32
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -1525,7 +1525,7 @@ static int bttv_s_ctrl(struct file *file, void *f,
	struct bttv_fh *fh = f;
	struct bttv *btv = fh->btv;

	err = v4l2_prio_check(&btv->prio, &fh->prio);
	err = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != err)
		return err;

@@ -1859,7 +1859,7 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
	unsigned int i;
	int err;

	err = v4l2_prio_check(&btv->prio, &fh->prio);
	err = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != err)
		return err;

@@ -1941,7 +1941,7 @@ static int bttv_s_input(struct file *file, void *priv, unsigned int i)

	int err;

	err = v4l2_prio_check(&btv->prio, &fh->prio);
	err = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != err)
		return err;

@@ -1961,7 +1961,7 @@ static int bttv_s_tuner(struct file *file, void *priv,
	struct bttv *btv = fh->btv;
	int err;

	err = v4l2_prio_check(&btv->prio, &fh->prio);
	err = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != err)
		return err;

@@ -2001,7 +2001,7 @@ static int bttv_s_frequency(struct file *file, void *priv,
	struct bttv *btv = fh->btv;
	int err;

	err = v4l2_prio_check(&btv->prio, &fh->prio);
	err = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != err)
		return err;

@@ -3024,7 +3024,7 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
	    crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
		return -EINVAL;

	retval = v4l2_prio_check(&btv->prio, &fh->prio);
	retval = v4l2_prio_check(&btv->prio, fh->prio);
	if (0 != retval)
		return retval;

@@ -3307,7 +3307,7 @@ static int bttv_release(struct file *file)
	/* free stuff */
	videobuf_mmap_free(&fh->cap);
	videobuf_mmap_free(&fh->vbi);
	v4l2_prio_close(&btv->prio,&fh->prio);
	v4l2_prio_close(&btv->prio, fh->prio);
	file->private_data = NULL;
	kfree(fh);

@@ -3444,7 +3444,7 @@ static int radio_release(struct file *file)
	struct bttv *btv = fh->btv;
	struct rds_command cmd;

	v4l2_prio_close(&btv->prio,&fh->prio);
	v4l2_prio_close(&btv->prio, fh->prio);
	file->private_data = NULL;
	kfree(fh);

+2 −2
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ static int cpia2_close(struct file *file)
	{
		if(fh->mmapped)
			cam->mmapped = 0;
		v4l2_prio_close(&cam->prio,&fh->prio);
		v4l2_prio_close(&cam->prio, fh->prio);
		file->private_data = NULL;
		kfree(fh);
	}
@@ -1592,7 +1592,7 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
	case VIDIOC_S_FMT:
	{
		struct cpia2_fh *fh = file->private_data;
		retval = v4l2_prio_check(&cam->prio, &fh->prio);
		retval = v4l2_prio_check(&cam->prio, fh->prio);
		if(retval) {
			mutex_unlock(&cam->busy_lock);
			return retval;
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ int cx18_s_ext_ctrls(struct file *file, void *fh, struct v4l2_ext_controls *c)
	int ret;
	struct v4l2_control ctrl;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

+1 −1
Original line number Diff line number Diff line
@@ -700,7 +700,7 @@ int cx18_v4l2_close(struct file *filp)

	CX18_DEBUG_IOCTL("close() of %s\n", s->name);

	v4l2_prio_close(&cx->prio, &id->prio);
	v4l2_prio_close(&cx->prio, id->prio);

	/* Easy case first: this stream was never claimed by us */
	if (s->id != id->open_id) {
+8 −8
Original line number Diff line number Diff line
@@ -277,7 +277,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
	int ret;
	int w, h;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -306,7 +306,7 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -341,7 +341,7 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
	int ret;
	struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -549,7 +549,7 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -601,7 +601,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -647,7 +647,7 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -675,7 +675,7 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

@@ -715,7 +715,7 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
	struct cx18 *cx = id->cx;
	int ret;

	ret = v4l2_prio_check(&cx->prio, &id->prio);
	ret = v4l2_prio_check(&cx->prio, id->prio);
	if (ret)
		return ret;

Loading