aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2010-05-01 07:03:24 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-05-19 11:58:54 -0400
commitffb4877ba013f94322083f77cbb05b35c2a218aa (patch)
tree0d041da73986e1dc7c845ff4418fb20f46bd7506
parent530d2d32068eaf3616e0ce9e58a5fde5701c3380 (diff)
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 <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c18
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c4
-rw-r--r--drivers/media/video/cx18/cx18-controls.c2
-rw-r--r--drivers/media/video/cx18/cx18-fileops.c2
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c16
-rw-r--r--drivers/media/video/davinci/vpfe_capture.c2
-rw-r--r--drivers/media/video/davinci/vpif_capture.c8
-rw-r--r--drivers/media/video/davinci/vpif_display.c4
-rw-r--r--drivers/media/video/ivtv/ivtv-fileops.c2
-rw-r--r--drivers/media/video/ivtv/ivtv-ioctl.c2
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-v4l2.c6
-rw-r--r--drivers/media/video/saa7134/saa7134-video.c14
-rw-r--r--drivers/media/video/v4l2-common.c22
-rw-r--r--drivers/staging/cx25821/cx25821-audups11.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video.c11
-rw-r--r--drivers/staging/cx25821/cx25821-video0.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video1.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video2.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video3.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video4.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video5.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video6.c6
-rw-r--r--drivers/staging/cx25821/cx25821-video7.c6
-rw-r--r--drivers/staging/cx25821/cx25821-videoioctl.c6
-rw-r--r--drivers/staging/cx25821/cx25821-vidups10.c6
-rw-r--r--drivers/staging/cx25821/cx25821-vidups9.c6
-rw-r--r--include/media/v4l2-common.h8
27 files changed, 94 insertions, 99 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index fcfc934a3667..38c7f78ad9cf 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,
1525 struct bttv_fh *fh = f; 1525 struct bttv_fh *fh = f;
1526 struct bttv *btv = fh->btv; 1526 struct bttv *btv = fh->btv;
1527 1527
1528 err = v4l2_prio_check(&btv->prio, &fh->prio); 1528 err = v4l2_prio_check(&btv->prio, fh->prio);
1529 if (0 != err) 1529 if (0 != err)
1530 return err; 1530 return err;
1531 1531
@@ -1859,7 +1859,7 @@ static int bttv_s_std(struct file *file, void *priv, v4l2_std_id *id)
1859 unsigned int i; 1859 unsigned int i;
1860 int err; 1860 int err;
1861 1861
1862 err = v4l2_prio_check(&btv->prio, &fh->prio); 1862 err = v4l2_prio_check(&btv->prio, fh->prio);
1863 if (0 != err) 1863 if (0 != err)
1864 return err; 1864 return err;
1865 1865
@@ -1941,7 +1941,7 @@ static int bttv_s_input(struct file *file, void *priv, unsigned int i)
1941 1941
1942 int err; 1942 int err;
1943 1943
1944 err = v4l2_prio_check(&btv->prio, &fh->prio); 1944 err = v4l2_prio_check(&btv->prio, fh->prio);
1945 if (0 != err) 1945 if (0 != err)
1946 return err; 1946 return err;
1947 1947
@@ -1961,7 +1961,7 @@ static int bttv_s_tuner(struct file *file, void *priv,
1961 struct bttv *btv = fh->btv; 1961 struct bttv *btv = fh->btv;
1962 int err; 1962 int err;
1963 1963
1964 err = v4l2_prio_check(&btv->prio, &fh->prio); 1964 err = v4l2_prio_check(&btv->prio, fh->prio);
1965 if (0 != err) 1965 if (0 != err)
1966 return err; 1966 return err;
1967 1967
@@ -2001,7 +2001,7 @@ static int bttv_s_frequency(struct file *file, void *priv,
2001 struct bttv *btv = fh->btv; 2001 struct bttv *btv = fh->btv;
2002 int err; 2002 int err;
2003 2003
2004 err = v4l2_prio_check(&btv->prio, &fh->prio); 2004 err = v4l2_prio_check(&btv->prio, fh->prio);
2005 if (0 != err) 2005 if (0 != err)
2006 return err; 2006 return err;
2007 2007
@@ -3024,7 +3024,7 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
3024 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) 3024 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
3025 return -EINVAL; 3025 return -EINVAL;
3026 3026
3027 retval = v4l2_prio_check(&btv->prio, &fh->prio); 3027 retval = v4l2_prio_check(&btv->prio, fh->prio);
3028 if (0 != retval) 3028 if (0 != retval)
3029 return retval; 3029 return retval;
3030 3030
@@ -3236,7 +3236,7 @@ static int bttv_open(struct file *file)
3236 *fh = btv->init; 3236 *fh = btv->init;
3237 fh->type = type; 3237 fh->type = type;
3238 fh->ov.setup_ok = 0; 3238 fh->ov.setup_ok = 0;
3239 v4l2_prio_open(&btv->prio,&fh->prio); 3239 v4l2_prio_open(&btv->prio, &fh->prio);
3240 3240
3241 videobuf_queue_sg_init(&fh->cap, &bttv_video_qops, 3241 videobuf_queue_sg_init(&fh->cap, &bttv_video_qops,
3242 &btv->c.pci->dev, &btv->s_lock, 3242 &btv->c.pci->dev, &btv->s_lock,
@@ -3307,7 +3307,7 @@ static int bttv_release(struct file *file)
3307 /* free stuff */ 3307 /* free stuff */
3308 videobuf_mmap_free(&fh->cap); 3308 videobuf_mmap_free(&fh->cap);
3309 videobuf_mmap_free(&fh->vbi); 3309 videobuf_mmap_free(&fh->vbi);
3310 v4l2_prio_close(&btv->prio,&fh->prio); 3310 v4l2_prio_close(&btv->prio, fh->prio);
3311 file->private_data = NULL; 3311 file->private_data = NULL;
3312 kfree(fh); 3312 kfree(fh);
3313 3313
@@ -3444,7 +3444,7 @@ static int radio_release(struct file *file)
3444 struct bttv *btv = fh->btv; 3444 struct bttv *btv = fh->btv;
3445 struct rds_command cmd; 3445 struct rds_command cmd;
3446 3446
3447 v4l2_prio_close(&btv->prio,&fh->prio); 3447 v4l2_prio_close(&btv->prio, fh->prio);
3448 file->private_data = NULL; 3448 file->private_data = NULL;
3449 kfree(fh); 3449 kfree(fh);
3450 3450
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index 6f91415eb7b4..5520789854da 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)
324 { 324 {
325 if(fh->mmapped) 325 if(fh->mmapped)
326 cam->mmapped = 0; 326 cam->mmapped = 0;
327 v4l2_prio_close(&cam->prio,&fh->prio); 327 v4l2_prio_close(&cam->prio, fh->prio);
328 file->private_data = NULL; 328 file->private_data = NULL;
329 kfree(fh); 329 kfree(fh);
330 } 330 }
@@ -1592,7 +1592,7 @@ static long cpia2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
1592 case VIDIOC_S_FMT: 1592 case VIDIOC_S_FMT:
1593 { 1593 {
1594 struct cpia2_fh *fh = file->private_data; 1594 struct cpia2_fh *fh = file->private_data;
1595 retval = v4l2_prio_check(&cam->prio, &fh->prio); 1595 retval = v4l2_prio_check(&cam->prio, fh->prio);
1596 if(retval) { 1596 if(retval) {
1597 mutex_unlock(&cam->busy_lock); 1597 mutex_unlock(&cam->busy_lock);
1598 return retval; 1598 return retval;
diff --git a/drivers/media/video/cx18/cx18-controls.c b/drivers/media/video/cx18/cx18-controls.c
index 7fa589240ff2..4b4b46544d5a 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)
263 int ret; 263 int ret;
264 struct v4l2_control ctrl; 264 struct v4l2_control ctrl;
265 265
266 ret = v4l2_prio_check(&cx->prio, &id->prio); 266 ret = v4l2_prio_check(&cx->prio, id->prio);
267 if (ret) 267 if (ret)
268 return ret; 268 return ret;
269 269
diff --git a/drivers/media/video/cx18/cx18-fileops.c b/drivers/media/video/cx18/cx18-fileops.c
index 863ce7758239..e12a15020cda 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)
700 700
701 CX18_DEBUG_IOCTL("close() of %s\n", s->name); 701 CX18_DEBUG_IOCTL("close() of %s\n", s->name);
702 702
703 v4l2_prio_close(&cx->prio, &id->prio); 703 v4l2_prio_close(&cx->prio, id->prio);
704 704
705 /* Easy case first: this stream was never claimed by us */ 705 /* Easy case first: this stream was never claimed by us */
706 if (s->id != id->open_id) { 706 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 2e6addab3ed6..2530fc54daaf 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,
277 int ret; 277 int ret;
278 int w, h; 278 int w, h;
279 279
280 ret = v4l2_prio_check(&cx->prio, &id->prio); 280 ret = v4l2_prio_check(&cx->prio, id->prio);
281 if (ret) 281 if (ret)
282 return ret; 282 return ret;
283 283
@@ -306,7 +306,7 @@ static int cx18_s_fmt_vbi_cap(struct file *file, void *fh,
306 struct cx18 *cx = id->cx; 306 struct cx18 *cx = id->cx;
307 int ret; 307 int ret;
308 308
309 ret = v4l2_prio_check(&cx->prio, &id->prio); 309 ret = v4l2_prio_check(&cx->prio, id->prio);
310 if (ret) 310 if (ret)
311 return ret; 311 return ret;
312 312
@@ -341,7 +341,7 @@ static int cx18_s_fmt_sliced_vbi_cap(struct file *file, void *fh,
341 int ret; 341 int ret;
342 struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced; 342 struct v4l2_sliced_vbi_format *vbifmt = &fmt->fmt.sliced;
343 343
344 ret = v4l2_prio_check(&cx->prio, &id->prio); 344 ret = v4l2_prio_check(&cx->prio, id->prio);
345 if (ret) 345 if (ret)
346 return ret; 346 return ret;
347 347
@@ -549,7 +549,7 @@ static int cx18_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
549 struct cx18 *cx = id->cx; 549 struct cx18 *cx = id->cx;
550 int ret; 550 int ret;
551 551
552 ret = v4l2_prio_check(&cx->prio, &id->prio); 552 ret = v4l2_prio_check(&cx->prio, id->prio);
553 if (ret) 553 if (ret)
554 return ret; 554 return ret;
555 555
@@ -601,7 +601,7 @@ int cx18_s_input(struct file *file, void *fh, unsigned int inp)
601 struct cx18 *cx = id->cx; 601 struct cx18 *cx = id->cx;
602 int ret; 602 int ret;
603 603
604 ret = v4l2_prio_check(&cx->prio, &id->prio); 604 ret = v4l2_prio_check(&cx->prio, id->prio);
605 if (ret) 605 if (ret)
606 return ret; 606 return ret;
607 607
@@ -647,7 +647,7 @@ int cx18_s_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
647 struct cx18 *cx = id->cx; 647 struct cx18 *cx = id->cx;
648 int ret; 648 int ret;
649 649
650 ret = v4l2_prio_check(&cx->prio, &id->prio); 650 ret = v4l2_prio_check(&cx->prio, id->prio);
651 if (ret) 651 if (ret)
652 return ret; 652 return ret;
653 653
@@ -675,7 +675,7 @@ int cx18_s_std(struct file *file, void *fh, v4l2_std_id *std)
675 struct cx18 *cx = id->cx; 675 struct cx18 *cx = id->cx;
676 int ret; 676 int ret;
677 677
678 ret = v4l2_prio_check(&cx->prio, &id->prio); 678 ret = v4l2_prio_check(&cx->prio, id->prio);
679 if (ret) 679 if (ret)
680 return ret; 680 return ret;
681 681
@@ -715,7 +715,7 @@ static int cx18_s_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
715 struct cx18 *cx = id->cx; 715 struct cx18 *cx = id->cx;
716 int ret; 716 int ret;
717 717
718 ret = v4l2_prio_check(&cx->prio, &id->prio); 718 ret = v4l2_prio_check(&cx->prio, id->prio);
719 if (ret) 719 if (ret)
720 return ret; 720 return ret;
721 721
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
index f6648f6ba2fc..1c2588247289 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)
736 /* Decrement device usrs counter */ 736 /* Decrement device usrs counter */
737 vpfe_dev->usrs--; 737 vpfe_dev->usrs--;
738 /* Close the priority */ 738 /* Close the priority */
739 v4l2_prio_close(&vpfe_dev->prio, &fh->prio); 739 v4l2_prio_close(&vpfe_dev->prio, fh->prio);
740 /* If this is the last file handle */ 740 /* If this is the last file handle */
741 if (!vpfe_dev->usrs) { 741 if (!vpfe_dev->usrs) {
742 vpfe_dev->initialized = 0; 742 vpfe_dev->initialized = 0;
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 2e5a7fb2d0c9..a7f48b53d3fc 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)
869 mutex_unlock(&common->lock); 869 mutex_unlock(&common->lock);
870 870
871 /* Close the priority */ 871 /* Close the priority */
872 v4l2_prio_close(&ch->prio, &fh->prio); 872 v4l2_prio_close(&ch->prio, fh->prio);
873 873
874 if (fh->initialized) 874 if (fh->initialized)
875 ch->initialized = 0; 875 ch->initialized = 0;
@@ -1444,7 +1444,7 @@ static int vpif_s_std(struct file *file, void *priv, v4l2_std_id *std_id)
1444 } 1444 }
1445 } 1445 }
1446 1446
1447 ret = v4l2_prio_check(&ch->prio, &fh->prio); 1447 ret = v4l2_prio_check(&ch->prio, fh->prio);
1448 if (0 != ret) 1448 if (0 != ret)
1449 return ret; 1449 return ret;
1450 1450
@@ -1554,7 +1554,7 @@ static int vpif_s_input(struct file *file, void *priv, unsigned int index)
1554 } 1554 }
1555 } 1555 }
1556 1556
1557 ret = v4l2_prio_check(&ch->prio, &fh->prio); 1557 ret = v4l2_prio_check(&ch->prio, fh->prio);
1558 if (0 != ret) 1558 if (0 != ret)
1559 return ret; 1559 return ret;
1560 1560
@@ -1710,7 +1710,7 @@ static int vpif_s_fmt_vid_cap(struct file *file, void *priv,
1710 } 1710 }
1711 } 1711 }
1712 1712
1713 ret = v4l2_prio_check(&ch->prio, &fh->prio); 1713 ret = v4l2_prio_check(&ch->prio, fh->prio);
1714 if (0 != ret) 1714 if (0 != ret)
1715 return ret; 1715 return ret;
1716 1716
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index e5bab3d0d53f..da07607cbc55 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)
671 ch->initialized = 0; 671 ch->initialized = 0;
672 672
673 /* Close the priority */ 673 /* Close the priority */
674 v4l2_prio_close(&ch->prio, &fh->prio); 674 v4l2_prio_close(&ch->prio, fh->prio);
675 filep->private_data = NULL; 675 filep->private_data = NULL;
676 fh->initialized = 0; 676 fh->initialized = 0;
677 kfree(fh); 677 kfree(fh);
@@ -753,7 +753,7 @@ static int vpif_s_fmt_vid_out(struct file *file, void *priv,
753 } 753 }
754 754
755 /* Check for the priority */ 755 /* Check for the priority */
756 ret = v4l2_prio_check(&ch->prio, &fh->prio); 756 ret = v4l2_prio_check(&ch->prio, fh->prio);
757 if (0 != ret) 757 if (0 != ret)
758 return ret; 758 return ret;
759 fh->initialized = 1; 759 fh->initialized = 1;
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c
index bee9605bd273..abf410943cc9 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)
853 853
854 IVTV_DEBUG_FILE("close %s\n", s->name); 854 IVTV_DEBUG_FILE("close %s\n", s->name);
855 855
856 v4l2_prio_close(&itv->prio, &id->prio); 856 v4l2_prio_close(&itv->prio, id->prio);
857 v4l2_fh_del(fh); 857 v4l2_fh_del(fh);
858 v4l2_fh_exit(fh); 858 v4l2_fh_exit(fh);
859 859
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c
index a17c659e6327..6573764f506d 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,
1851 case VIDIOC_S_EXT_CTRLS: 1851 case VIDIOC_S_EXT_CTRLS:
1852 case VIDIOC_S_FBUF: 1852 case VIDIOC_S_FBUF:
1853 case VIDIOC_OVERLAY: 1853 case VIDIOC_OVERLAY:
1854 ret = v4l2_prio_check(&itv->prio, &id->prio); 1854 ret = v4l2_prio_check(&itv->prio, id->prio);
1855 if (ret) 1855 if (ret)
1856 return ret; 1856 return ret;
1857 } 1857 }
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index fe4159d478b3..5ffa0d2b0b0d 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)
183 case VIDIOC_S_INPUT: 183 case VIDIOC_S_INPUT:
184 case VIDIOC_S_TUNER: 184 case VIDIOC_S_TUNER:
185 case VIDIOC_S_FREQUENCY: 185 case VIDIOC_S_FREQUENCY:
186 ret = v4l2_prio_check(&vp->prio, &fh->prio); 186 ret = v4l2_prio_check(&vp->prio, fh->prio);
187 if (ret) 187 if (ret)
188 return ret; 188 return ret;
189 } 189 }
@@ -972,7 +972,7 @@ static int pvr2_v4l2_release(struct file *file)
972 fhp->rhp = NULL; 972 fhp->rhp = NULL;
973 } 973 }
974 974
975 v4l2_prio_close(&vp->prio, &fhp->prio); 975 v4l2_prio_close(&vp->prio, fhp->prio);
976 file->private_data = NULL; 976 file->private_data = NULL;
977 977
978 if (fhp->vnext) { 978 if (fhp->vnext) {
@@ -1093,7 +1093,7 @@ static int pvr2_v4l2_open(struct file *file)
1093 1093
1094 fhp->file = file; 1094 fhp->file = file;
1095 file->private_data = fhp; 1095 file->private_data = fhp;
1096 v4l2_prio_open(&vp->prio,&fhp->prio); 1096 v4l2_prio_open(&vp->prio, &fhp->prio);
1097 1097
1098 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw); 1098 fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw);
1099 1099
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 7806fb17e742..45f0ac8f3c0f 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
1180 That needs to be fixed somehow, but for now this is 1180 That needs to be fixed somehow, but for now this is
1181 good enough. */ 1181 good enough. */
1182 if (fh) { 1182 if (fh) {
1183 err = v4l2_prio_check(&dev->prio, &fh->prio); 1183 err = v4l2_prio_check(&dev->prio, fh->prio);
1184 if (0 != err) 1184 if (0 != err)
1185 return err; 1185 return err;
1186 } 1186 }
@@ -1359,7 +1359,7 @@ static int video_open(struct file *file)
1359 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24); 1359 fh->fmt = format_by_fourcc(V4L2_PIX_FMT_BGR24);
1360 fh->width = 720; 1360 fh->width = 720;
1361 fh->height = 576; 1361 fh->height = 576;
1362 v4l2_prio_open(&dev->prio,&fh->prio); 1362 v4l2_prio_open(&dev->prio, &fh->prio);
1363 1363
1364 videobuf_queue_sg_init(&fh->cap, &video_qops, 1364 videobuf_queue_sg_init(&fh->cap, &video_qops,
1365 &dev->pci->dev, &dev->slock, 1365 &dev->pci->dev, &dev->slock,
@@ -1502,7 +1502,7 @@ static int video_release(struct file *file)
1502 saa7134_pgtable_free(dev->pci,&fh->pt_cap); 1502 saa7134_pgtable_free(dev->pci,&fh->pt_cap);
1503 saa7134_pgtable_free(dev->pci,&fh->pt_vbi); 1503 saa7134_pgtable_free(dev->pci,&fh->pt_vbi);
1504 1504
1505 v4l2_prio_close(&dev->prio,&fh->prio); 1505 v4l2_prio_close(&dev->prio, fh->prio);
1506 file->private_data = NULL; 1506 file->private_data = NULL;
1507 kfree(fh); 1507 kfree(fh);
1508 return 0; 1508 return 0;
@@ -1785,7 +1785,7 @@ static int saa7134_s_input(struct file *file, void *priv, unsigned int i)
1785 struct saa7134_dev *dev = fh->dev; 1785 struct saa7134_dev *dev = fh->dev;
1786 int err; 1786 int err;
1787 1787
1788 err = v4l2_prio_check(&dev->prio, &fh->prio); 1788 err = v4l2_prio_check(&dev->prio, fh->prio);
1789 if (0 != err) 1789 if (0 != err)
1790 return err; 1790 return err;
1791 1791
@@ -1839,7 +1839,7 @@ int saa7134_s_std_internal(struct saa7134_dev *dev, struct saa7134_fh *fh, v4l2_
1839 That needs to be fixed somehow, but for now this is 1839 That needs to be fixed somehow, but for now this is
1840 good enough. */ 1840 good enough. */
1841 if (fh) { 1841 if (fh) {
1842 err = v4l2_prio_check(&dev->prio, &fh->prio); 1842 err = v4l2_prio_check(&dev->prio, fh->prio);
1843 if (0 != err) 1843 if (0 != err)
1844 return err; 1844 return err;
1845 } else if (res_locked(dev, RESOURCE_OVERLAY)) { 1845 } else if (res_locked(dev, RESOURCE_OVERLAY)) {
@@ -2023,7 +2023,7 @@ static int saa7134_s_tuner(struct file *file, void *priv,
2023 struct saa7134_dev *dev = fh->dev; 2023 struct saa7134_dev *dev = fh->dev;
2024 int rx, mode, err; 2024 int rx, mode, err;
2025 2025
2026 err = v4l2_prio_check(&dev->prio, &fh->prio); 2026 err = v4l2_prio_check(&dev->prio, fh->prio);
2027 if (0 != err) 2027 if (0 != err)
2028 return err; 2028 return err;
2029 2029
@@ -2057,7 +2057,7 @@ static int saa7134_s_frequency(struct file *file, void *priv,
2057 struct saa7134_dev *dev = fh->dev; 2057 struct saa7134_dev *dev = fh->dev;
2058 int err; 2058 int err;
2059 2059
2060 err = v4l2_prio_check(&dev->prio, &fh->prio); 2060 err = v4l2_prio_check(&dev->prio, fh->prio);
2061 if (0 != err) 2061 if (0 != err)
2062 return err; 2062 return err;
2063 2063
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 035c414507a1..4e53b0b3339c 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -88,10 +88,9 @@ MODULE_LICENSE("GPL");
88 val == V4L2_PRIORITY_INTERACTIVE || \ 88 val == V4L2_PRIORITY_INTERACTIVE || \
89 val == V4L2_PRIORITY_RECORD) 89 val == V4L2_PRIORITY_RECORD)
90 90
91int v4l2_prio_init(struct v4l2_prio_state *global) 91void v4l2_prio_init(struct v4l2_prio_state *global)
92{ 92{
93 memset(global,0,sizeof(*global)); 93 memset(global, 0, sizeof(*global));
94 return 0;
95} 94}
96EXPORT_SYMBOL(v4l2_prio_init); 95EXPORT_SYMBOL(v4l2_prio_init);
97 96
@@ -111,17 +110,16 @@ int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
111} 110}
112EXPORT_SYMBOL(v4l2_prio_change); 111EXPORT_SYMBOL(v4l2_prio_change);
113 112
114int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local) 113void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local)
115{ 114{
116 return v4l2_prio_change(global,local,V4L2_PRIORITY_DEFAULT); 115 v4l2_prio_change(global, local, V4L2_PRIORITY_DEFAULT);
117} 116}
118EXPORT_SYMBOL(v4l2_prio_open); 117EXPORT_SYMBOL(v4l2_prio_open);
119 118
120int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local) 119void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local)
121{ 120{
122 if (V4L2_PRIO_VALID(*local)) 121 if (V4L2_PRIO_VALID(local))
123 atomic_dec(&global->prios[*local]); 122 atomic_dec(&global->prios[local]);
124 return 0;
125} 123}
126EXPORT_SYMBOL(v4l2_prio_close); 124EXPORT_SYMBOL(v4l2_prio_close);
127 125
@@ -137,11 +135,9 @@ enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global)
137} 135}
138EXPORT_SYMBOL(v4l2_prio_max); 136EXPORT_SYMBOL(v4l2_prio_max);
139 137
140int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local) 138int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local)
141{ 139{
142 if (*local < v4l2_prio_max(global)) 140 return (local < v4l2_prio_max(global)) ? -EBUSY : 0;
143 return -EBUSY;
144 return 0;
145} 141}
146EXPORT_SYMBOL(v4l2_prio_check); 142EXPORT_SYMBOL(v4l2_prio_check);
147 143
diff --git a/drivers/staging/cx25821/cx25821-audups11.c b/drivers/staging/cx25821/cx25821-audups11.c
index 9193a6eb7cf2..e49ead982f39 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)
203 203
204 videobuf_mmap_free(&fh->vidq); 204 videobuf_mmap_free(&fh->vidq);
205 205
206 v4l2_prio_close(&dev->prio, &fh->prio); 206 v4l2_prio_close(&dev->prio, fh->prio);
207 207
208 file->private_data = NULL; 208 file->private_data = NULL;
209 kfree(fh); 209 kfree(fh);
@@ -258,7 +258,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
258 int err; 258 int err;
259 259
260 if (fh) { 260 if (fh) {
261 err = v4l2_prio_check(&dev->prio, &fh->prio); 261 err = v4l2_prio_check(&dev->prio, fh->prio);
262 if (0 != err) 262 if (0 != err)
263 return err; 263 return err;
264 } 264 }
@@ -350,7 +350,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
350 350
351 if (fh) { 351 if (fh) {
352 dev = fh->dev; 352 dev = fh->dev;
353 err = v4l2_prio_check(&dev->prio, &fh->prio); 353 err = v4l2_prio_check(&dev->prio, fh->prio);
354 if (0 != err) 354 if (0 != err)
355 return err; 355 return err;
356 } 356 }
diff --git a/drivers/staging/cx25821/cx25821-video.c b/drivers/staging/cx25821/cx25821-video.c
index a3bea2739cef..791212c1a661 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)
846 dprintk(1, "%s()\n", __func__); 846 dprintk(1, "%s()\n", __func__);
847 847
848 if (fh) { 848 if (fh) {
849 err = v4l2_prio_check(&dev->prio, &fh->prio); 849 err = v4l2_prio_check(&dev->prio, fh->prio);
850 if (0 != err) 850 if (0 != err)
851 return err; 851 return err;
852 } 852 }
@@ -916,7 +916,7 @@ int cx25821_vidioc_s_input(struct file *file, void *priv, unsigned int i)
916 dprintk(1, "%s(%d)\n", __func__, i); 916 dprintk(1, "%s(%d)\n", __func__, i);
917 917
918 if (fh) { 918 if (fh) {
919 err = v4l2_prio_check(&dev->prio, &fh->prio); 919 err = v4l2_prio_check(&dev->prio, fh->prio);
920 if (0 != err) 920 if (0 != err)
921 return err; 921 return err;
922 } 922 }
@@ -967,8 +967,7 @@ int cx25821_vidioc_s_frequency(struct file *file, void *priv, struct v4l2_freque
967 int err; 967 int err;
968 968
969 if (fh) { 969 if (fh) {
970 dev = fh->dev; 970 err = v4l2_prio_check(&dev->prio, fh->prio);
971 err = v4l2_prio_check(&dev->prio, &fh->prio);
972 if (0 != err) 971 if (0 != err)
973 return err; 972 return err;
974 } 973 }
@@ -1032,7 +1031,7 @@ int cx25821_vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *t)
1032 int err; 1031 int err;
1033 1032
1034 if (fh) { 1033 if (fh) {
1035 err = v4l2_prio_check(&dev->prio, &fh->prio); 1034 err = v4l2_prio_check(&dev->prio, fh->prio);
1036 if (0 != err) 1035 if (0 != err)
1037 return err; 1036 return err;
1038 } 1037 }
@@ -1240,7 +1239,7 @@ int cx25821_vidioc_s_crop(struct file *file, void *priv, struct v4l2_crop *crop)
1240 int err; 1239 int err;
1241 1240
1242 if (fh) { 1241 if (fh) {
1243 err = v4l2_prio_check(&dev->prio, &fh->prio); 1242 err = v4l2_prio_check(&dev->prio, fh->prio);
1244 if (0 != err) 1243 if (0 != err)
1245 return err; 1244 return err;
1246 } 1245 }
diff --git a/drivers/staging/cx25821/cx25821-video0.c b/drivers/staging/cx25821/cx25821-video0.c
index 1f95ddba8499..0be2cc15d856 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)
219 219
220 videobuf_mmap_free(&fh->vidq); 220 videobuf_mmap_free(&fh->vidq);
221 221
222 v4l2_prio_close(&dev->prio, &fh->prio); 222 v4l2_prio_close(&dev->prio, fh->prio);
223 file->private_data = NULL; 223 file->private_data = NULL;
224 kfree(fh); 224 kfree(fh);
225 225
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 int pix_format = PIXEL_FRMT_422; 274 int pix_format = PIXEL_FRMT_422;
275 275
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
363 int err; 363 int err;
364 364
365 if (fh) { 365 if (fh) {
366 err = v4l2_prio_check(&dev->prio, &fh->prio); 366 err = v4l2_prio_check(&dev->prio, fh->prio);
367 if (0 != err) 367 if (0 != err)
368 return err; 368 return err;
369 } 369 }
diff --git a/drivers/staging/cx25821/cx25821-video1.c b/drivers/staging/cx25821/cx25821-video1.c
index 9b94462a62cf..b0bae627bfb1 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)
219 219
220 videobuf_mmap_free(&fh->vidq); 220 videobuf_mmap_free(&fh->vidq);
221 221
222 v4l2_prio_close(&dev->prio, &fh->prio); 222 v4l2_prio_close(&dev->prio, fh->prio);
223 file->private_data = NULL; 223 file->private_data = NULL;
224 kfree(fh); 224 kfree(fh);
225 225
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 int pix_format = 0; 274 int pix_format = 0;
275 275
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
363 int err; 363 int err;
364 364
365 if (fh) { 365 if (fh) {
366 err = v4l2_prio_check(&dev->prio, &fh->prio); 366 err = v4l2_prio_check(&dev->prio, fh->prio);
367 if (0 != err) 367 if (0 != err)
368 return err; 368 return err;
369 } 369 }
diff --git a/drivers/staging/cx25821/cx25821-video2.c b/drivers/staging/cx25821/cx25821-video2.c
index 31c46aa2e563..400cdb80674e 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)
219 219
220 videobuf_mmap_free(&fh->vidq); 220 videobuf_mmap_free(&fh->vidq);
221 221
222 v4l2_prio_close(&dev->prio, &fh->prio); 222 v4l2_prio_close(&dev->prio, fh->prio);
223 file->private_data = NULL; 223 file->private_data = NULL;
224 kfree(fh); 224 kfree(fh);
225 225
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 int pix_format = 0; 274 int pix_format = 0;
275 275
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -365,7 +365,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
365 int err; 365 int err;
366 366
367 if (fh) { 367 if (fh) {
368 err = v4l2_prio_check(&dev->prio, &fh->prio); 368 err = v4l2_prio_check(&dev->prio, fh->prio);
369 if (0 != err) 369 if (0 != err)
370 return err; 370 return err;
371 } 371 }
diff --git a/drivers/staging/cx25821/cx25821-video3.c b/drivers/staging/cx25821/cx25821-video3.c
index cbc5cad24a08..3b216ed0906e 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)
219 219
220 videobuf_mmap_free(&fh->vidq); 220 videobuf_mmap_free(&fh->vidq);
221 221
222 v4l2_prio_close(&dev->prio, &fh->prio); 222 v4l2_prio_close(&dev->prio, fh->prio);
223 file->private_data = NULL; 223 file->private_data = NULL;
224 kfree(fh); 224 kfree(fh);
225 225
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 int pix_format = 0; 274 int pix_format = 0;
275 275
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -364,7 +364,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
364 int err; 364 int err;
365 365
366 if (fh) { 366 if (fh) {
367 err = v4l2_prio_check(&dev->prio, &fh->prio); 367 err = v4l2_prio_check(&dev->prio, fh->prio);
368 if (0 != err) 368 if (0 != err)
369 return err; 369 return err;
370 } 370 }
diff --git a/drivers/staging/cx25821/cx25821-video4.c b/drivers/staging/cx25821/cx25821-video4.c
index 101074ad742c..f7b08c51868a 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)
218 218
219 videobuf_mmap_free(&fh->vidq); 219 videobuf_mmap_free(&fh->vidq);
220 220
221 v4l2_prio_close(&dev->prio, &fh->prio); 221 v4l2_prio_close(&dev->prio, fh->prio);
222 file->private_data = NULL; 222 file->private_data = NULL;
223 kfree(fh); 223 kfree(fh);
224 224
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 274
275 // check priority 275 // check priority
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
363 int err; 363 int err;
364 364
365 if (fh) { 365 if (fh) {
366 err = v4l2_prio_check(&dev->prio, &fh->prio); 366 err = v4l2_prio_check(&dev->prio, fh->prio);
367 if (0 != err) 367 if (0 != err)
368 return err; 368 return err;
369 } 369 }
diff --git a/drivers/staging/cx25821/cx25821-video5.c b/drivers/staging/cx25821/cx25821-video5.c
index 2019c5e3ea14..59370337b076 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)
219 219
220 videobuf_mmap_free(&fh->vidq); 220 videobuf_mmap_free(&fh->vidq);
221 221
222 v4l2_prio_close(&dev->prio, &fh->prio); 222 v4l2_prio_close(&dev->prio, fh->prio);
223 file->private_data = NULL; 223 file->private_data = NULL;
224 kfree(fh); 224 kfree(fh);
225 225
@@ -274,7 +274,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
274 int pix_format = 0; 274 int pix_format = 0;
275 275
276 if (fh) { 276 if (fh) {
277 err = v4l2_prio_check(&dev->prio, &fh->prio); 277 err = v4l2_prio_check(&dev->prio, fh->prio);
278 if (0 != err) 278 if (0 != err)
279 return err; 279 return err;
280 } 280 }
@@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
363 int err; 363 int err;
364 364
365 if (fh) { 365 if (fh) {
366 err = v4l2_prio_check(&dev->prio, &fh->prio); 366 err = v4l2_prio_check(&dev->prio, fh->prio);
367 if (0 != err) 367 if (0 != err)
368 return err; 368 return err;
369 } 369 }
diff --git a/drivers/staging/cx25821/cx25821-video6.c b/drivers/staging/cx25821/cx25821-video6.c
index d19c786e5a5f..4db2eb83d35a 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)
218 218
219 videobuf_mmap_free(&fh->vidq); 219 videobuf_mmap_free(&fh->vidq);
220 220
221 v4l2_prio_close(&dev->prio, &fh->prio); 221 v4l2_prio_close(&dev->prio, fh->prio);
222 file->private_data = NULL; 222 file->private_data = NULL;
223 kfree(fh); 223 kfree(fh);
224 224
@@ -273,7 +273,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
273 int pix_format = 0; 273 int pix_format = 0;
274 274
275 if (fh) { 275 if (fh) {
276 err = v4l2_prio_check(&dev->prio, &fh->prio); 276 err = v4l2_prio_check(&dev->prio, fh->prio);
277 if (0 != err) 277 if (0 != err)
278 return err; 278 return err;
279 } 279 }
@@ -363,7 +363,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
363 int err; 363 int err;
364 364
365 if (fh) { 365 if (fh) {
366 err = v4l2_prio_check(&dev->prio, &fh->prio); 366 err = v4l2_prio_check(&dev->prio, fh->prio);
367 if (0 != err) 367 if (0 != err)
368 return err; 368 return err;
369 } 369 }
diff --git a/drivers/staging/cx25821/cx25821-video7.c b/drivers/staging/cx25821/cx25821-video7.c
index 8a7c854a0fc8..5e4a769badad 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)
218 218
219 videobuf_mmap_free(&fh->vidq); 219 videobuf_mmap_free(&fh->vidq);
220 220
221 v4l2_prio_close(&dev->prio, &fh->prio); 221 v4l2_prio_close(&dev->prio, fh->prio);
222 file->private_data = NULL; 222 file->private_data = NULL;
223 kfree(fh); 223 kfree(fh);
224 224
@@ -273,7 +273,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
273 int pix_format = 0; 273 int pix_format = 0;
274 274
275 if (fh) { 275 if (fh) {
276 err = v4l2_prio_check(&dev->prio, &fh->prio); 276 err = v4l2_prio_check(&dev->prio, fh->prio);
277 if (0 != err) 277 if (0 != err)
278 return err; 278 return err;
279 } 279 }
@@ -362,7 +362,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
362 int err; 362 int err;
363 363
364 if (fh) { 364 if (fh) {
365 err = v4l2_prio_check(&dev->prio, &fh->prio); 365 err = v4l2_prio_check(&dev->prio, fh->prio);
366 if (0 != err) 366 if (0 != err)
367 return err; 367 return err;
368 } 368 }
diff --git a/drivers/staging/cx25821/cx25821-videoioctl.c b/drivers/staging/cx25821/cx25821-videoioctl.c
index 840714a9415f..d16807d88be0 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)
201 201
202 videobuf_mmap_free(&fh->vidq); 202 videobuf_mmap_free(&fh->vidq);
203 203
204 v4l2_prio_close(&dev->prio, &fh->prio); 204 v4l2_prio_close(&dev->prio, fh->prio);
205 205
206 file->private_data = NULL; 206 file->private_data = NULL;
207 kfree(fh); 207 kfree(fh);
@@ -256,7 +256,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
256 int err; 256 int err;
257 257
258 if (fh) { 258 if (fh) {
259 err = v4l2_prio_check(&dev->prio, &fh->prio); 259 err = v4l2_prio_check(&dev->prio, fh->prio);
260 if (0 != err) 260 if (0 != err)
261 return err; 261 return err;
262 } 262 }
@@ -409,7 +409,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
409 int err; 409 int err;
410 410
411 if (fh) { 411 if (fh) {
412 err = v4l2_prio_check(&dev->prio, &fh->prio); 412 err = v4l2_prio_check(&dev->prio, fh->prio);
413 if (0 != err) 413 if (0 != err)
414 return err; 414 return err;
415 } 415 }
diff --git a/drivers/staging/cx25821/cx25821-vidups10.c b/drivers/staging/cx25821/cx25821-vidups10.c
index 89c8592e5f02..c746a17ccbd2 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)
201 201
202 videobuf_mmap_free(&fh->vidq); 202 videobuf_mmap_free(&fh->vidq);
203 203
204 v4l2_prio_close(&dev->prio, &fh->prio); 204 v4l2_prio_close(&dev->prio, fh->prio);
205 205
206 file->private_data = NULL; 206 file->private_data = NULL;
207 kfree(fh); 207 kfree(fh);
@@ -299,7 +299,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
299 int err; 299 int err;
300 300
301 if (fh) { 301 if (fh) {
302 err = v4l2_prio_check(&dev->prio, &fh->prio); 302 err = v4l2_prio_check(&dev->prio, fh->prio);
303 if (0 != err) 303 if (0 != err)
304 return err; 304 return err;
305 } 305 }
@@ -347,7 +347,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
347 int err; 347 int err;
348 348
349 if (fh) { 349 if (fh) {
350 err = v4l2_prio_check(&dev->prio, &fh->prio); 350 err = v4l2_prio_check(&dev->prio, fh->prio);
351 if (0 != err) 351 if (0 != err)
352 return err; 352 return err;
353 } 353 }
diff --git a/drivers/staging/cx25821/cx25821-vidups9.c b/drivers/staging/cx25821/cx25821-vidups9.c
index c8e8083c7934..466e0f34ae34 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)
201 201
202 videobuf_mmap_free(&fh->vidq); 202 videobuf_mmap_free(&fh->vidq);
203 203
204 v4l2_prio_close(&dev->prio, &fh->prio); 204 v4l2_prio_close(&dev->prio, fh->prio);
205 205
206 file->private_data = NULL; 206 file->private_data = NULL;
207 kfree(fh); 207 kfree(fh);
@@ -299,7 +299,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
299 int err; 299 int err;
300 300
301 if (fh) { 301 if (fh) {
302 err = v4l2_prio_check(&dev->prio, &fh->prio); 302 err = v4l2_prio_check(&dev->prio, fh->prio);
303 if (0 != err) 303 if (0 != err)
304 return err; 304 return err;
305 } 305 }
@@ -345,7 +345,7 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
345 struct cx25821_fh *fh = priv; 345 struct cx25821_fh *fh = priv;
346 int err; 346 int err;
347 if (fh) { 347 if (fh) {
348 err = v4l2_prio_check(&dev->prio, &fh->prio); 348 err = v4l2_prio_check(&dev->prio, fh->prio);
349 if (0 != err) 349 if (0 != err)
350 return err; 350 return err;
351 } 351 }
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 3b2efdc6d065..98b32645e5a7 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -85,13 +85,13 @@
85struct v4l2_prio_state { 85struct v4l2_prio_state {
86 atomic_t prios[4]; 86 atomic_t prios[4];
87}; 87};
88int v4l2_prio_init(struct v4l2_prio_state *global); 88void v4l2_prio_init(struct v4l2_prio_state *global);
89int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local, 89int v4l2_prio_change(struct v4l2_prio_state *global, enum v4l2_priority *local,
90 enum v4l2_priority new); 90 enum v4l2_priority new);
91int v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local); 91void v4l2_prio_open(struct v4l2_prio_state *global, enum v4l2_priority *local);
92int v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority *local); 92void v4l2_prio_close(struct v4l2_prio_state *global, enum v4l2_priority local);
93enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global); 93enum v4l2_priority v4l2_prio_max(struct v4l2_prio_state *global);
94int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority *local); 94int v4l2_prio_check(struct v4l2_prio_state *global, enum v4l2_priority local);
95 95
96/* ------------------------------------------------------------------------- */ 96/* ------------------------------------------------------------------------- */
97 97