struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
unsigned int i;
- int err;
-
- err = v4l2_prio_check(&btv->prio, fh->prio);
- if (err)
- goto err;
+ int err = 0;
for (i = 0; i < BTTV_TVNORMS; i++)
if (*id & bttv_tvnorms[i].v4l2_id)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
- int err;
-
- err = v4l2_prio_check(&btv->prio, fh->prio);
- if (err)
- return err;
if (i >= bttv_tvcards[btv->c.type].video_inputs)
return -EINVAL;
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
- int err;
if (t->index)
return -EINVAL;
- err = v4l2_prio_check(&btv->prio, fh->prio);
- if (err)
- return err;
-
bttv_call_all(btv, tuner, s_tuner, t);
if (btv->audio_mode_gpio)
{
struct bttv_fh *fh = priv;
struct bttv *btv = fh->btv;
- int err;
if (f->tuner)
return -EINVAL;
- err = v4l2_prio_check(&btv->prio, fh->prio);
- if (err)
- return err;
bttv_set_frequency(btv, f);
return 0;
}
return 0;
}
-static int bttv_g_priority(struct file *file, void *f, enum v4l2_priority *p)
-{
- struct bttv_fh *fh = f;
- struct bttv *btv = fh->btv;
-
- *p = v4l2_prio_max(&btv->prio);
-
- return 0;
-}
-
-static int bttv_s_priority(struct file *file, void *f,
- enum v4l2_priority prio)
-{
- struct bttv_fh *fh = f;
- struct bttv *btv = fh->btv;
- int rc;
-
- rc = v4l2_prio_change(&btv->prio, &fh->prio, prio);
-
- return rc;
-}
-
static int bttv_cropcap(struct file *file, void *priv,
struct v4l2_cropcap *cap)
{
/* Make sure tvnorm, vbi_end and the current cropping
parameters remain consistent until we're done. Note
read() may change vbi_end in check_alloc_btres_lock(). */
- retval = v4l2_prio_check(&btv->prio, fh->prio);
- if (0 != retval) {
- return retval;
- }
-
retval = -EBUSY;
if (locked_btres(fh->btv, VIDEO_RESOURCES)) {
fh->type = type;
fh->ov.setup_ok = 0;
- v4l2_prio_open(&btv->prio, &fh->prio);
-
videobuf_queue_sg_init(&fh->cap, &bttv_video_qops,
&btv->c.pci->dev, &btv->s_lock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
videobuf_mmap_free(&fh->cap);
videobuf_mmap_free(&fh->vbi);
- v4l2_prio_close(&btv->prio, fh->prio);
file->private_data = NULL;
btv->users--;
.vidioc_g_fbuf = bttv_g_fbuf,
.vidioc_s_fbuf = bttv_s_fbuf,
.vidioc_overlay = bttv_overlay,
- .vidioc_g_priority = bttv_g_priority,
- .vidioc_s_priority = bttv_s_priority,
.vidioc_g_parm = bttv_g_parm,
.vidioc_g_frequency = bttv_g_frequency,
.vidioc_s_frequency = bttv_s_frequency,
return -ENOMEM;
file->private_data = fh;
*fh = btv->init;
-
- v4l2_prio_open(&btv->prio, &fh->prio);
+ v4l2_fh_init(&fh->fh, vdev);
btv->radio_user++;
bttv_call_all(btv, tuner, s_radio);
audio_input(btv,TVAUDIO_INPUT_RADIO);
+ v4l2_fh_add(&fh->fh);
return 0;
}
struct bttv *btv = fh->btv;
struct saa6588_command cmd;
- v4l2_prio_close(&btv->prio, fh->prio);
file->private_data = NULL;
+ v4l2_fh_del(&fh->fh);
+ v4l2_fh_exit(&fh->fh);
kfree(fh);
btv->radio_user--;
vfd->v4l2_dev = &btv->c.v4l2_dev;
vfd->release = video_device_release;
vfd->debug = bttv_debug;
+ set_bit(V4L2_FL_USE_FH_PRIO, &vfd->flags);
video_set_drvdata(vfd, btv);
snprintf(vfd->name, sizeof(vfd->name), "BT%d%s %s (%s)",
btv->id, (btv->id==848 && btv->revision==0x12) ? "A" : "",
INIT_LIST_HEAD(&btv->c.subs);
INIT_LIST_HEAD(&btv->capture);
INIT_LIST_HEAD(&btv->vcapture);
- v4l2_prio_init(&btv->prio);
init_timer(&btv->timeout);
btv->timeout.function = bttv_irq_timeout;