V4L/DVB: v4l2-common: simplify prio utility functions
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 1 May 2010 11:03:24 +0000 (08:03 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:58:54 +0000 (12:58 -0300)
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 <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
27 files changed:
drivers/media/video/bt8xx/bttv-driver.c
drivers/media/video/cpia2/cpia2_v4l.c
drivers/media/video/cx18/cx18-controls.c
drivers/media/video/cx18/cx18-fileops.c
drivers/media/video/cx18/cx18-ioctl.c
drivers/media/video/davinci/vpfe_capture.c
drivers/media/video/davinci/vpif_capture.c
drivers/media/video/davinci/vpif_display.c
drivers/media/video/ivtv/ivtv-fileops.c
drivers/media/video/ivtv/ivtv-ioctl.c
drivers/media/video/pvrusb2/pvrusb2-v4l2.c
drivers/media/video/saa7134/saa7134-video.c
drivers/media/video/v4l2-common.c
drivers/staging/cx25821/cx25821-audups11.c
drivers/staging/cx25821/cx25821-video.c
drivers/staging/cx25821/cx25821-video0.c
drivers/staging/cx25821/cx25821-video1.c
drivers/staging/cx25821/cx25821-video2.c
drivers/staging/cx25821/cx25821-video3.c
drivers/staging/cx25821/cx25821-video4.c
drivers/staging/cx25821/cx25821-video5.c
drivers/staging/cx25821/cx25821-video6.c
drivers/staging/cx25821/cx25821-video7.c
drivers/staging/cx25821/cx25821-videoioctl.c
drivers/staging/cx25821/cx25821-vidups10.c
drivers/staging/cx25821/cx25821-vidups9.c
include/media/v4l2-common.h

index fcfc934a36670d628c61c6373d72a043a0c03089..38c7f78ad9cf0bb3763ea373ed3c141f846670a5 100644 (file)
@@ -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);
 
index 6f91415eb7b4c8afcf9a641549e064033ef304cb..5520789854dadb7f628b4432a1d8f855815f5bc4 100644 (file)
@@ -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;
index 7fa589240ff2ab03ae71a6ad39172fd19a6465bc..4b4b46544d5a2443c754c0cd9ca4e9966710e5f2 100644 (file)
@@ -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;
 
index 863ce77582391d953a0edde0375f344fdf07c8ab..e12a15020cdab5f62ce8af1b9d9afb5f15702bc5 100644 (file)
@@ -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) {
index 2e6addab3ed6a6bf258ad4931c152950c05810af..2530fc54daaf6bd711b387a86f850ecf6ef47a99 100644 (file)
@@ -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;
 
index f6648f6ba2fc25d8c118ccf4e5f5b5330a42398f..1c2588247289dbf4ce4f8c80c8b3d795e1dcff80 100644 (file)
@@ -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;
index 2e5a7fb2d0c9e0e678f9f34f800c3c545611418b..a7f48b53d3fc5aac3ac1cc48c770d6061e3ff8f4 100644 (file)
@@ -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;
 
index e5bab3d0d53f89c36df1702920cfbef8694b1faf..da07607cbc55859a2286f36afd254ae0f7e90595 100644 (file)
@@ -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;
index bee9605bd273e0b294c06b562a4df0451f295af8..abf410943cc9f54cdf2047597c07117f1408f102 100644 (file)
@@ -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);
 
index a17c659e6327d10a52b88a113ec02d7a2992a839..6573764f506d6d42157f5c7b981bb72128f0f18c 100644 (file)
@@ -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;
        }
index fe4159d478b3a4f529059dca0cf2578846d2171c..5ffa0d2b0b0d957c9b94d118110078f4daf9eb22 100644 (file)
@@ -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);
 
index 7806fb17e742fee3c1161062f6d8020479463e7d..45f0ac8f3c0f88dcf877041cd364535450ff2638 100644 (file)
@@ -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;
 
index 035c414507a138d6bbbc8181aef07b1f5e696ca1..4e53b0b3339ceda15b4ab0a2a6f017970d082bf6 100644 (file)
@@ -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);
 
index 9193a6eb7cf22cd7b29085385e5bdb90140706e7..e49ead982f397542141918abcbf736f2cbe9fc88 100644 (file)
@@ -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;
        }
index a3bea2739cefb159224a474386c7be724c1c65bf..791212c1a661d65e25a13cf2b3a63dd24b86e7af 100644 (file)
@@ -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;
        }
index 1f95ddba8499d3cfc5ac71c3ba8855d880f7683c..0be2cc15d856fe1e012a3970e1cbc708f6d8d301 100644 (file)
@@ -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;
        }
index 9b94462a62cf7f1cf49f6aeddada697650ad6308..b0bae627bfb1ca77e22d7233cac6838743056799 100644 (file)
@@ -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;
        }
index 31c46aa2e5636cbe16ff280057847622d5280957..400cdb80674ef2933a477c290d0790ad4220bf07 100644 (file)
@@ -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;
        }
index cbc5cad24a08542edfc25e7214c8a14eaacffa55..3b216ed0906ef91c597fe7459cf3a5f6d4a32c22 100644 (file)
@@ -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;
        }
index 101074ad742c5a444abb24c008376762e10283f9..f7b08c51868ac69cd3721f4f5b81cc6301e0d168 100644 (file)
@@ -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;
        }
index 2019c5e3ea14967aa126f28932fe93957941bb71..59370337b076a93faaa4ea9404d66ba9ce15c977 100644 (file)
@@ -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;
        }
index d19c786e5a5f8afdad1eea8a5317f9fe95340a2d..4db2eb83d35a500f784451343401a7af6480d46b 100644 (file)
@@ -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;
        }
index 8a7c854a0fc8924e373d0f22ecc2f3e7f7685742..5e4a769badade7570bf1cc112cfef25d103585a0 100644 (file)
@@ -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;
        }
index 840714a9415f041923beaa310ece8a4bb79bf6dc..d16807d88be0175887256bf0a64107eb195df970 100644 (file)
@@ -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;
        }
index 89c8592e5f02a02a6da5aab81d6c87a0640c1c0c..c746a17ccbd28239fc3d6966b0ca5cd93070b307 100644 (file)
@@ -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;
        }
index c8e8083c7934458f781d2f5de4edad04b726468b..466e0f34ae34981d882144a74a4662da15e64394 100644 (file)
@@ -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;
        }
index 3b2efdc6d0651bfa734ed776c21bfe320fad9337..98b32645e5a7aeb5c6cd427d5c627c714c8e4f88 100644 (file)
 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);
 
 /* ------------------------------------------------------------------------- */