diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-23 04:47:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:54 -0400 |
commit | f9e86b5e9d068854a2cf40f8003ef639e80cca6c (patch) | |
tree | 03b3ba79c4e099a6dcefd490e29d6310cc1d881a | |
parent | cb353588e1946ab709be57dd8545598793acf912 (diff) |
V4L/DVB (8782): v4l2-dev: add video_device_release_empty
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>
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 7 | ||||
-rw-r--r-- | include/media/v4l2-dev.h | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 66bd74b58b06..fda48a2efda6 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -73,6 +73,13 @@ void video_device_release(struct video_device *vfd) | |||
73 | } | 73 | } |
74 | EXPORT_SYMBOL(video_device_release); | 74 | EXPORT_SYMBOL(video_device_release); |
75 | 75 | ||
76 | void video_device_release_empty(struct video_device *vfd) | ||
77 | { | ||
78 | /* Do nothing */ | ||
79 | /* Only valid when the video_device struct is a static. */ | ||
80 | } | ||
81 | EXPORT_SYMBOL(video_device_release_empty); | ||
82 | |||
76 | static void video_release(struct device *cd) | 83 | static void video_release(struct device *cd) |
77 | { | 84 | { |
78 | struct video_device *vfd = container_of(cd, struct video_device, dev); | 85 | struct video_device *vfd = container_of(cd, struct video_device, dev); |
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index e472b5d07a55..30855077be44 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h | |||
@@ -91,7 +91,12 @@ void video_unregister_device(struct video_device *); | |||
91 | /* helper functions to alloc / release struct video_device, the | 91 | /* helper functions to alloc / release struct video_device, the |
92 | later can be used for video_device->release() */ | 92 | later can be used for video_device->release() */ |
93 | struct video_device *video_device_alloc(void); | 93 | struct video_device *video_device_alloc(void); |
94 | /* this release function frees the vfd pointer */ | ||
94 | void video_device_release(struct video_device *vfd); | 95 | void video_device_release(struct video_device *vfd); |
96 | /* this release function does nothing, use when the video_device is a | ||
97 | static global struct. Note that having a static video_device is | ||
98 | a dubious construction at best. */ | ||
99 | void video_device_release_empty(struct video_device *vfd); | ||
95 | 100 | ||
96 | #ifdef OBSOLETE_DEVDATA /* to be removed soon */ | 101 | #ifdef OBSOLETE_DEVDATA /* to be removed soon */ |
97 | /* helper functions to access driver private data. */ | 102 | /* helper functions to access driver private data. */ |