linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sh_veu: convert to struct v4l2_fh
@ 2019-07-23 12:25 Hans Verkuil
  0 siblings, 0 replies; only message in thread
From: Hans Verkuil @ 2019-07-23 12:25 UTC (permalink / raw)
  To: Linux Media Mailing List; +Cc: Jacopo Mondi

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>
---
diff --git a/drivers/media/platform/sh_veu.c b/drivers/media/platform/sh_veu.c
index 4be6efd47d33..2b4c0d9d6928 100644
--- a/drivers/media/platform/sh_veu.c
+++ b/drivers/media/platform/sh_veu.c
@@ -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);


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-07-23 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 12:25 [PATCH] sh_veu: convert to struct v4l2_fh Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).