Skip to content

Commit 610fce5

Browse files
Hans Verkuilmchehab
authored andcommitted
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>
1 parent 3c13505 commit 610fce5

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎drivers/media/platform/sh_veu.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
struct sh_veu_dev;
8282

8383
struct sh_veu_file {
84+
struct v4l2_fh fh;
8485
struct sh_veu_dev *veu_dev;
8586
bool cfg_needed;
8687
};
@@ -961,12 +962,14 @@ static int sh_veu_open(struct file *file)
961962
if (!veu_file)
962963
return -ENOMEM;
963964

965+
v4l2_fh_init(&veu_file->fh, video_devdata(file));
964966
veu_file->veu_dev = veu;
965967
veu_file->cfg_needed = true;
966968

967969
file->private_data = veu_file;
968970

969971
pm_runtime_get_sync(veu->dev);
972+
v4l2_fh_add(&veu_file->fh);
970973

971974
dev_dbg(veu->dev, "Created instance %p\n", veu_file);
972975

@@ -996,6 +999,8 @@ static int sh_veu_release(struct file *file)
996999
}
9971000

9981001
pm_runtime_put(veu->dev);
1002+
v4l2_fh_del(&veu_file->fh);
1003+
v4l2_fh_exit(&veu_file->fh);
9991004

10001005
kfree(veu_file);
10011006

0 commit comments

Comments
 (0)