Commit 610fce53 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

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: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 3c135050
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);