]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (8782): v4l2-dev: add video_device_release_empty
authorHans Verkuil <hverkuil@xs4all.nl>
Sat, 23 Aug 2008 08:47:41 +0000 (05:47 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Oct 2008 11:36:54 +0000 (09:36 -0200)
Add a second release function: video_device_release_empty
It can be used by drivers that have statically allocated
video_device structs.

Its use usually, but not always, indicates laziness on the
part of the driver programmer.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l2-dev.c
include/media/v4l2-dev.h

index 66bd74b58b068aaeb63e8c06c8ba281252a0f9d9..fda48a2efda69d62fc3a343c0ae0f9a8cfe49208 100644 (file)
@@ -73,6 +73,13 @@ void video_device_release(struct video_device *vfd)
 }
 EXPORT_SYMBOL(video_device_release);
 
+void video_device_release_empty(struct video_device *vfd)
+{
+       /* Do nothing */
+       /* Only valid when the video_device struct is a static. */
+}
+EXPORT_SYMBOL(video_device_release_empty);
+
 static void video_release(struct device *cd)
 {
        struct video_device *vfd = container_of(cd, struct video_device, dev);
index e472b5d07a55b244c9aafdb02cd626d8d17f6666..30855077be44071fbd5934c7c825e8bce062dcc9 100644 (file)
@@ -91,7 +91,12 @@ void video_unregister_device(struct video_device *);
 /* helper functions to alloc / release struct video_device, the
    later can be used for video_device->release() */
 struct video_device *video_device_alloc(void);
+/* this release function frees the vfd pointer */
 void video_device_release(struct video_device *vfd);
+/* this release function does nothing, use when the video_device is a
+   static global struct. Note that having a static video_device is
+   a dubious construction at best. */
+void video_device_release_empty(struct video_device *vfd);
 
 #ifdef OBSOLETE_DEVDATA /* to be removed soon */
 /* helper functions to access driver private data. */