From: Hans Verkuil Date: Sat, 1 May 2010 11:03:24 +0000 (-0300) Subject: V4L/DVB: v4l2-common: simplify prio utility functions X-Git-Tag: upstream/snapshot3+hdmi~14575^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ffb4877ba013f94322083f77cbb05b35c2a218aa;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index fcfc934..38c7f78 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -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; @@ -3236,7 +3236,7 @@ static int bttv_open(struct file *file) *fh = btv->init; fh->type = type; fh->ov.setup_ok = 0; - v4l2_prio_open(&btv->prio,&fh->prio); + v4l2_prio_open(&btv->prio, &fh->prio); videobuf_queue_sg_init(&fh->cap, &bttv_video_qops, &btv->c.pci->dev, &btv->s_lock, @@ -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); diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c index 6f91415..5520789 100644 --- a/drivers/media/video/cpia2/cpia2_v4l.c +++ b/drivers/media/video/cpia2/cpia2_v4l.c @@ -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; diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c index 7fa5892..4b4b465 100644 --- a/drivers/media/video/cx18/cx18-controls.c +++ b/drivers/media/video/cx18/cx18-controls.c @@ -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; diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c index 863ce77..e12a150 100644 --- a/drivers/media/video/cx18/cx18-fileops.c +++ b/drivers/media/video/cx18/cx18-fileops.c @@ -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) { diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index 2e6adda..2530fc5 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c @@ -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; diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index f6648f6..1c25882 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c @@ -736,7 +736,7 @@ static int vpfe_release(struct file *file) /* Decrement device usrs counter */ vpfe_dev->usrs--; /* Close the priority */ - v4l2_prio_close(&vpfe_dev->prio, &fh->prio); + v4l2_prio_close(&vpfe_dev->prio, fh->prio); /* If this is the last file handle */ if (!vpfe_dev->usrs) { vpfe_dev->initialized = 0; diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 2e5a7fb..a7f48b5 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c @@ -869,7 +869,7 @@ static int vpif_release(struct file *filep) mutex_unlock(&common->lock); /* Close the priority */ - v4l2_prio_close(&ch->prio, &fh->prio); + v4l2_prio_close(&ch->prio, fh->prio); if (fh->initialized) ch->initialized = 0; @@ -1444,7 +1444,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id) } } - ret = v4l2_prio_check(&ch->prio, &fh->prio); + ret = v4l2_prio_check(&ch->prio, fh->prio); if (0 != ret) return ret; @@ -1554,7 +1554,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index) } } - ret = v4l2_prio_check(&ch->prio, &fh->prio); + ret = v4l2_prio_check(&ch->prio, fh->prio); if (0 != ret) return ret; @@ -1710,7 +1710,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv, } } - ret = v4l2_prio_check(&ch->prio, &fh->prio); + ret = v4l2_prio_check(&ch->prio, fh->prio); if (0 != ret) return ret; diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index e5bab3d..da07607 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c @@ -671,7 +671,7 @@ static int vpif_release(struct file *filep) ch->initialized = 0; /* Close the priority */ - v4l2_prio_close(&ch->prio, &fh->prio); + v4l2_prio_close(&ch->prio, fh->prio); filep->private_data = NULL; fh->initialized = 0; kfree(fh); @@ -753,7 +753,7 @@ static int vpif_s_fmt_vid_out(struct file *file, void *priv, } /* Check for the priority */ - ret = v4l2_prio_check(&ch->prio, &fh->prio); + ret = v4l2_prio_check(&ch->prio, fh->prio); if (0 != ret) return ret; fh->initialized = 1; diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index bee9605..abf4109 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c @@ -853,7 +853,7 @@ int ivtv_v4l2_close(struct file *filp) IVTV_DEBUG_FILE("close %s\n", s->name); - v4l2_prio_close(&itv->prio, &id->prio); + v4l2_prio_close(&itv->prio, id->prio); v4l2_fh_del(fh); v4l2_fh_exit(fh); diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index a17c659..6573764 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c @@ -1851,7 +1851,7 @@ static long ivtv_serialized_ioctl(struct ivtv *itv, struct file *filp, case VIDIOC_S_EXT_CTRLS: case VIDIOC_S_FBUF: case VIDIOC_OVERLAY: - ret = v4l2_prio_check(&itv->prio, &id->prio); + ret = v4l2_prio_check(&itv->prio, id->prio); if (ret) return ret; } diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index fe4159d..5ffa0d2 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c @@ -183,7 +183,7 @@ static long pvr2_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg) case VIDIOC_S_INPUT: case VIDIOC_S_TUNER: case VIDIOC_S_FREQUENCY: - ret = v4l2_prio_check(&vp->prio, &fh->prio); + ret = v4l2_prio_check(&vp->prio, fh->prio); if (ret) return ret; } @@ -972,7 +972,7 @@ static int pvr2_v4l2_release(struct file *file) fhp->rhp = NULL; } - v4l2_prio_close(&vp->prio, &fhp->prio); + v4l2_prio_close(&vp->prio, fhp->prio); file->private_data = NULL; if (fhp->vnext) { @@ -1093,7 +1093,7 @@ static int pvr2_v4l2_open(struct file *file) fhp->file = file; file->private_data = fhp; - v4l2_prio_open(&vp->prio,&fhp->prio); + v4l2_prio_open(&vp->prio, &fhp->prio); fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw); diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 7806fb1..45f0ac8 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c @@ -1180,7 +1180,7 @@ int saa7134_s_ctrl_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, str That needs to be fixed somehow, but for now this is good enough. */ if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -1359,7 +1359,7 @@ static int video_open(struct file *file) fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); fh->width = 720; fh->height = 576; - v4l2_prio_open(&dev->prio,&fh->prio); + v4l2_prio_open(&dev->prio, &fh->prio); videobuf_queue_sg_init(&fh->cap, &video_qops, &dev->pci->dev, &dev->slock, @@ -1502,7 +1502,7 @@ static int video_release(struct file *file) saa7134_pgtable_free(dev->pci,&fh->pt_cap); saa7134_pgtable_free(dev->pci,&fh->pt_vbi); - v4l2_prio_close(&dev->prio,&fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); return 0; @@ -1785,7 +1785,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i) struct saa7134_dev *dev = fh->dev; int err; - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; @@ -1839,7 +1839,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_ That needs to be fixed somehow, but for now this is good enough. */ if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } else if (res_locked(dev, RESOURCE_OVERLAY)) { @@ -2023,7 +2023,7 @@ static int saa7134_s_tuner(struct file *file, void *priv, struct saa7134_dev *dev = fh->dev; int rx, mode, err; - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; @@ -2057,7 +2057,7 @@ static int saa7134_s_frequency(struct file *file, void *priv, struct saa7134_dev *dev = fh->dev; int err; - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 035c414..4e53b0b 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c @@ -88,10 +88,9 @@ MODULE_LICENSE("GPL"); val == V4L2_PRIORITY_INTERACTIVE || \ val == V4L2_PRIORITY_RECORD) -int v4l2_prio_init(struct v4l2_prio_state *global) +void v4l2_prio_init(struct v4l2_prio_state *global) { - memset(global,0,sizeof(*global)); - return 0; + memset(global, 0, sizeof(*global)); } EXPORT_SYMBOL(v4l2_prio_init); @@ -111,17 +110,16 @@ int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, } EXPORT_SYMBOL(v4l2_prio_change); -int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local) +void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local) { - return v4l2_prio_change(global,local,V4L2_PRIORITY_DEFAULT); + v4l2_prio_change(global, local, V4L2_PRIORITY_DEFAULT); } EXPORT_SYMBOL(v4l2_prio_open); -int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local) +void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local) { - if (V4L2_PRIO_VALID(*local)) - atomic_dec(&global->prios[*local]); - return 0; + if (V4L2_PRIO_VALID(local)) + atomic_dec(&global->prios[local]); } EXPORT_SYMBOL(v4l2_prio_close); @@ -137,11 +135,9 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global) } EXPORT_SYMBOL(v4l2_prio_max); -int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local) +int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local) { - if (*local < v4l2_prio_max(global)) - return -EBUSY; - return 0; + return (local < v4l2_prio_max(global)) ? -EBUSY : 0; } EXPORT_SYMBOL(v4l2_prio_check); diff --git a/drivers/staging/cx25821/cx25821-audups11.c b/drivers/staging/cx25821/cx25821-audups11.c index 9193a6e..e49ead9 100644 --- a/drivers/staging/cx25821/cx25821-audups11.c +++ b/drivers/staging/cx25821/cx25821-audups11.c @@ -203,7 +203,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -258,7 +258,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -350,7 +350,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, if (fh) { dev = fh->dev; - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c index a3bea27..791212c 100644 --- a/drivers/staging/cx25821/cx25821-video.c +++ b/drivers/staging/cx25821/cx25821-video.c @@ -846,7 +846,7 @@ int cx25821_vidioc_s_std(struct file *file, void *priv, v4l2_std_id * tvnorms) dprintk(1, "%s()\n", __func__); if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -916,7 +916,7 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i) dprintk(1, "%s(%d)\n", __func__, i); if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -967,8 +967,7 @@ int cx25821_vidioc_s_frequency(struct file *file, void *priv, struct v4l2_freque int err; if (fh) { - dev = fh->dev; - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -1032,7 +1031,7 @@ int cx25821_vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t) int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -1240,7 +1239,7 @@ int cx25821_vidioc_s_crop(struct file *file, void *priv, struct v4l2_crop *crop) int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video0.c b/drivers/staging/cx25821/cx25821-video0.c index 1f95ddb..0be2cc1 100644 --- a/drivers/staging/cx25821/cx25821-video0.c +++ b/drivers/staging/cx25821/cx25821-video0.c @@ -219,7 +219,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = PIXEL_FRMT_422; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video1.c b/drivers/staging/cx25821/cx25821-video1.c index 9b94462..b0bae627 100644 --- a/drivers/staging/cx25821/cx25821-video1.c +++ b/drivers/staging/cx25821/cx25821-video1.c @@ -219,7 +219,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video2.c b/drivers/staging/cx25821/cx25821-video2.c index 31c46aa..400cdb8 100644 --- a/drivers/staging/cx25821/cx25821-video2.c +++ b/drivers/staging/cx25821/cx25821-video2.c @@ -219,7 +219,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -365,7 +365,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video3.c b/drivers/staging/cx25821/cx25821-video3.c index cbc5cad..3b216ed 100644 --- a/drivers/staging/cx25821/cx25821-video3.c +++ b/drivers/staging/cx25821/cx25821-video3.c @@ -219,7 +219,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -364,7 +364,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video4.c b/drivers/staging/cx25821/cx25821-video4.c index 101074a..f7b08c5 100644 --- a/drivers/staging/cx25821/cx25821-video4.c +++ b/drivers/staging/cx25821/cx25821-video4.c @@ -218,7 +218,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, // check priority if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video5.c b/drivers/staging/cx25821/cx25821-video5.c index 2019c5e..5937033 100644 --- a/drivers/staging/cx25821/cx25821-video5.c +++ b/drivers/staging/cx25821/cx25821-video5.c @@ -219,7 +219,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video6.c b/drivers/staging/cx25821/cx25821-video6.c index d19c786..4db2eb8 100644 --- a/drivers/staging/cx25821/cx25821-video6.c +++ b/drivers/staging/cx25821/cx25821-video6.c @@ -218,7 +218,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -273,7 +273,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-video7.c b/drivers/staging/cx25821/cx25821-video7.c index 8a7c854..5e4a769 100644 --- a/drivers/staging/cx25821/cx25821-video7.c +++ b/drivers/staging/cx25821/cx25821-video7.c @@ -218,7 +218,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -273,7 +273,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int pix_format = 0; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -362,7 +362,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-videoioctl.c b/drivers/staging/cx25821/cx25821-videoioctl.c index 840714a..d16807d 100644 --- a/drivers/staging/cx25821/cx25821-videoioctl.c +++ b/drivers/staging/cx25821/cx25821-videoioctl.c @@ -201,7 +201,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -256,7 +256,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -409,7 +409,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-vidups10.c b/drivers/staging/cx25821/cx25821-vidups10.c index 89c8592..c746a17 100644 --- a/drivers/staging/cx25821/cx25821-vidups10.c +++ b/drivers/staging/cx25821/cx25821-vidups10.c @@ -201,7 +201,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -299,7 +299,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -347,7 +347,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/drivers/staging/cx25821/cx25821-vidups9.c b/drivers/staging/cx25821/cx25821-vidups9.c index c8e8083..466e0f3 100644 --- a/drivers/staging/cx25821/cx25821-vidups9.c +++ b/drivers/staging/cx25821/cx25821-vidups9.c @@ -201,7 +201,7 @@ static int video_release(struct file *file) videobuf_mmap_free(&fh->vidq); - v4l2_prio_close(&dev->prio, &fh->prio); + v4l2_prio_close(&dev->prio, fh->prio); file->private_data = NULL; kfree(fh); @@ -299,7 +299,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } @@ -345,7 +345,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv, struct cx25821_fh *fh = priv; int err; if (fh) { - err = v4l2_prio_check(&dev->prio, &fh->prio); + err = v4l2_prio_check(&dev->prio, fh->prio); if (0 != err) return err; } diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 3b2efdc..98b3264 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h @@ -85,13 +85,13 @@ struct v4l2_prio_state { atomic_t prios[4]; }; -int v4l2_prio_init(struct v4l2_prio_state *global); +void v4l2_prio_init(struct v4l2_prio_state *global); int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, enum v4l2_priority new); -int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); -int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); +void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); +void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local); enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); -int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); +int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local); /* ------------------------------------------------------------------------- */