aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bt8xx/bttv-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/bt8xx/bttv-driver.c')
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index f4860f03dfc3..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
@@ -1806,8 +1806,8 @@ buffer_setup(struct videobuf_queue *q, unsigned int *count, unsigned int *size)
1806 *size = fh->fmt->depth*fh->width*fh->height >> 3; 1806 *size = fh->fmt->depth*fh->width*fh->height >> 3;
1807 if (0 == *count) 1807 if (0 == *count)
1808 *count = gbuffers; 1808 *count = gbuffers;
1809 while (*size * *count > gbuffers * gbufsize) 1809 if (*size * *count > gbuffers * gbufsize)
1810 (*count)--; 1810 *count = (gbuffers * gbufsize) / *size;
1811 return 0; 1811 return 0;
1812} 1812}
1813 1813
@@ -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
@@ -1987,11 +1987,6 @@ static int bttv_g_frequency(struct file *file, void *priv,
1987{ 1987{
1988 struct bttv_fh *fh = priv; 1988 struct bttv_fh *fh = priv;
1989 struct bttv *btv = fh->btv; 1989 struct bttv *btv = fh->btv;
1990 int err;
1991
1992 err = v4l2_prio_check(&btv->prio, &fh->prio);
1993 if (0 != err)
1994 return err;
1995 1990
1996 f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; 1991 f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV;
1997 f->frequency = btv->freq; 1992 f->frequency = btv->freq;
@@ -2006,7 +2001,7 @@ static int bttv_s_frequency(struct file *file, void *priv,
2006 struct bttv *btv = fh->btv; 2001 struct bttv *btv = fh->btv;
2007 int err; 2002 int err;
2008 2003
2009 err = v4l2_prio_check(&btv->prio, &fh->prio); 2004 err = v4l2_prio_check(&btv->prio, fh->prio);
2010 if (0 != err) 2005 if (0 != err)
2011 return err; 2006 return err;
2012 2007
@@ -3029,7 +3024,7 @@ static int bttv_s_crop(struct file *file, void *f, struct v4l2_crop *crop)
3029 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY) 3024 crop->type != V4L2_BUF_TYPE_VIDEO_OVERLAY)
3030 return -EINVAL; 3025 return -EINVAL;
3031 3026
3032 retval = v4l2_prio_check(&btv->prio, &fh->prio); 3027 retval = v4l2_prio_check(&btv->prio, fh->prio);
3033 if (0 != retval) 3028 if (0 != retval)
3034 return retval; 3029 return retval;
3035 3030
@@ -3241,7 +3236,7 @@ static int bttv_open(struct file *file)
3241 *fh = btv->init; 3236 *fh = btv->init;
3242 fh->type = type; 3237 fh->type = type;
3243 fh->ov.setup_ok = 0; 3238 fh->ov.setup_ok = 0;
3244 v4l2_prio_open(&btv->prio,&fh->prio); 3239 v4l2_prio_open(&btv->prio, &fh->prio);
3245 3240
3246 videobuf_queue_sg_init(&fh->cap, &bttv_video_qops, 3241 videobuf_queue_sg_init(&fh->cap, &bttv_video_qops,
3247 &btv->c.pci->dev, &btv->s_lock, 3242 &btv->c.pci->dev, &btv->s_lock,
@@ -3312,7 +3307,7 @@ static int bttv_release(struct file *file)
3312 /* free stuff */ 3307 /* free stuff */
3313 videobuf_mmap_free(&fh->cap); 3308 videobuf_mmap_free(&fh->cap);
3314 videobuf_mmap_free(&fh->vbi); 3309 videobuf_mmap_free(&fh->vbi);
3315 v4l2_prio_close(&btv->prio,&fh->prio); 3310 v4l2_prio_close(&btv->prio, fh->prio);
3316 file->private_data = NULL; 3311 file->private_data = NULL;
3317 kfree(fh); 3312 kfree(fh);
3318 3313
@@ -3449,7 +3444,7 @@ static int radio_release(struct file *file)
3449 struct bttv *btv = fh->btv; 3444 struct bttv *btv = fh->btv;
3450 struct rds_command cmd; 3445 struct rds_command cmd;
3451 3446
3452 v4l2_prio_close(&btv->prio,&fh->prio); 3447 v4l2_prio_close(&btv->prio, fh->prio);
3453 file->private_data = NULL; 3448 file->private_data = NULL;
3454 kfree(fh); 3449 kfree(fh);
3455 3450