media: sh_veu: convert to struct v4l2_fh
This driver didn't use struct v4l2_fh, so add it. This is a very basic conversion. I can't test this on real hardware, so I didn't dare to also convert the driver to start using the v4l2-mem2mem ioctl/fop helpers. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
3c1350501c
commit
610fce5372
1 changed files with 5 additions and 0 deletions
|
@ -81,6 +81,7 @@
|
|||
struct sh_veu_dev;
|
||||
|
||||
struct sh_veu_file {
|
||||
struct v4l2_fh fh;
|
||||
struct sh_veu_dev *veu_dev;
|
||||
bool cfg_needed;
|
||||
};
|
||||
|
@ -961,12 +962,14 @@ static int sh_veu_open(struct file *file)
|
|||
if (!veu_file)
|
||||
return -ENOMEM;
|
||||
|
||||
v4l2_fh_init(&veu_file->fh, video_devdata(file));
|
||||
veu_file->veu_dev = veu;
|
||||
veu_file->cfg_needed = true;
|
||||
|
||||
file->private_data = veu_file;
|
||||
|
||||
pm_runtime_get_sync(veu->dev);
|
||||
v4l2_fh_add(&veu_file->fh);
|
||||
|
||||
dev_dbg(veu->dev, "Created instance %p\n", veu_file);
|
||||
|
||||
|
@ -996,6 +999,8 @@ static int sh_veu_release(struct file *file)
|
|||
}
|
||||
|
||||
pm_runtime_put(veu->dev);
|
||||
v4l2_fh_del(&veu_file->fh);
|
||||
v4l2_fh_exit(&veu_file->fh);
|
||||
|
||||
kfree(veu_file);
|
||||
|
||||
|
|
Loading…
Reference in a new issue