aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-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
13 files changed, 49 insertions, 53 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