All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Added custom function for video device release functionality in tw686x driver
@ 2019-07-26 20:39 Mark Balantzyan
  0 siblings, 0 replies; only message in thread
From: Mark Balantzyan @ 2019-07-26 20:39 UTC (permalink / raw)
  To: linux-media; +Cc: Mark Balantzyan

Signed-off-by: Mark Balantzyan <mbalant3@gmail.com>
Reported-by: kbuild test robot <lkp@intel.com>
---
This patch adds a custom function in tw686x-video.c to provide a release mechanism for the driver for the tw686x video device.

 drivers/media/pci/tw686x/tw686x-video.c | 23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c
index 3a06c000..cabc4f89 100644
--- a/drivers/media/pci/tw686x/tw686x-video.c
+++ b/drivers/media/pci/tw686x/tw686x-video.c
@@ -1151,18 +1151,32 @@ void tw686x_video_irq(struct tw686x_dev *dev, unsigned long requests,
 	}
 }
 
+void tw686x_video_device_release(struct tw686x_video_channel *vc) {
+
+	struct tw686x_dev *dev = vc->dev;
+
+	unsigned int ch;
+
+	for (ch = 0; ch < max_channels(dev); ch++) {
+		struct tw686x_video_channel *vc = &dev->video_channels[ch];
+
+	}
+	
+	dev->dma_ops->free(vc,0);
+	
+	video_device_release((struct video_device*)dev);
+
+}
+
 void tw686x_video_free(struct tw686x_dev *dev)
 {
-	unsigned int ch, pb;
+	unsigned int ch;
 
 	for (ch = 0; ch < max_channels(dev); ch++) {
 		struct tw686x_video_channel *vc = &dev->video_channels[ch];
 
 		video_unregister_device(vc->device);
 
-		if (dev->dma_ops->free)
-			for (pb = 0; pb < 2; pb++)
-				dev->dma_ops->free(vc, pb);
 	}
 }
 
@@ -1277,7 +1291,6 @@ int tw686x_video_init(struct tw686x_dev *dev)
 		snprintf(vdev->name, sizeof(vdev->name), "%s video", dev->name);
 		vdev->fops = &tw686x_video_fops;
 		vdev->ioctl_ops = &tw686x_video_ioctl_ops;
-		vdev->release = video_device_release;
 		vdev->v4l2_dev = &dev->v4l2_dev;
 		vdev->queue = &vc->vidq;
 		vdev->tvnorms = V4L2_STD_525_60 | V4L2_STD_625_50;
-- 
2.17.1


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

only message in thread, other threads:[~2019-07-26 20:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-26 20:39 [PATCH] Added custom function for video device release functionality in tw686x driver Mark Balantzyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.