Add support for struct v4l2_fh and priority handling.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
static int mpeg_open(struct file *file)
{
+ struct video_device *vdev = video_devdata(file);
struct cx23885_dev *dev = video_drvdata(file);
struct cx23885_fh *fh;
if (!fh)
return -ENOMEM;
+ v4l2_fh_init(&fh->fh, vdev);
file->private_data = fh;
fh->dev = dev;
V4L2_FIELD_INTERLACED,
sizeof(struct cx23885_buffer),
fh, NULL);
+ v4l2_fh_add(&fh->fh);
return 0;
}
videobuf_read_stop(&fh->mpegq);
videobuf_mmap_free(&fh->mpegq);
+ v4l2_fh_del(&fh->fh);
+ v4l2_fh_exit(&fh->fh);
file->private_data = NULL;
kfree(fh);
if (NULL == fh)
return -ENOMEM;
- file->private_data = fh;
+ v4l2_fh_init(&fh->fh, vdev);
+ file->private_data = &fh->fh;
fh->dev = dev;
fh->radio = radio;
fh->type = type;
sizeof(struct cx23885_buffer),
fh, NULL);
+ v4l2_fh_add(&fh->fh);
dprintk(1, "post videobuf_queue_init()\n");
videobuf_mmap_free(&fh->vidq);
videobuf_mmap_free(&fh->vbiq);
+ v4l2_fh_del(&fh->fh);
+ v4l2_fh_exit(&fh->fh);
file->private_data = NULL;
kfree(fh);
#include <linux/slab.h>
#include <media/v4l2-device.h>
+#include <media/v4l2-fh.h>
#include <media/tuner.h>
#include <media/tveeprom.h>
#include <media/videobuf-dma-sg.h>
};
struct cx23885_fh {
+ struct v4l2_fh fh;
struct cx23885_dev *dev;
enum v4l2_buf_type type;
int radio;