From: Hans Verkuil Date: Wed, 23 Apr 2014 08:32:58 +0000 (-0300) Subject: [media] cx23885: support v4l2_fh and g/s_priority X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=86dd9831aea494e3e5c565c697df60484f55780c;p=linux-beck.git [media] cx23885: support v4l2_fh and g/s_priority Add support for struct v4l2_fh and priority handling. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/pci/cx23885/cx23885-417.c b/drivers/media/pci/cx23885/cx23885-417.c index bf89fc88692e..b65de33a6e23 100644 --- a/drivers/media/pci/cx23885/cx23885-417.c +++ b/drivers/media/pci/cx23885/cx23885-417.c @@ -1550,6 +1550,7 @@ static int vidioc_queryctrl(struct file *file, void *priv, 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; @@ -1560,6 +1561,7 @@ static int mpeg_open(struct file *file) if (!fh) return -ENOMEM; + v4l2_fh_init(&fh->fh, vdev); file->private_data = fh; fh->dev = dev; @@ -1569,6 +1571,7 @@ static int mpeg_open(struct file *file) V4L2_FIELD_INTERLACED, sizeof(struct cx23885_buffer), fh, NULL); + v4l2_fh_add(&fh->fh); return 0; } @@ -1601,6 +1604,8 @@ static int mpeg_release(struct file *file) 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); diff --git a/drivers/media/pci/cx23885/cx23885-video.c b/drivers/media/pci/cx23885/cx23885-video.c index 79de4acbf533..d575bfc8ac41 100644 --- a/drivers/media/pci/cx23885/cx23885-video.c +++ b/drivers/media/pci/cx23885/cx23885-video.c @@ -883,7 +883,8 @@ static int video_open(struct file *file) 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; @@ -905,6 +906,7 @@ static int video_open(struct file *file) sizeof(struct cx23885_buffer), fh, NULL); + v4l2_fh_add(&fh->fh); dprintk(1, "post videobuf_queue_init()\n"); @@ -1003,6 +1005,8 @@ static int video_release(struct file *file) 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); diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index 0e086c03da67..de164c986b1d 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -147,6 +148,7 @@ struct cx23885_tvnorm { }; struct cx23885_fh { + struct v4l2_fh fh; struct cx23885_dev *dev; enum v4l2_buf_type type; int radio;