summaryrefslogtreecommitdiff
path: root/linux/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-23 11:27:59 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-08-23 11:27:59 +0200
commite8c1796efb04c2a4423fc2367b7ae13d3e71f488 (patch)
tree1c92ba7dd728f190fd9c5da38538244a40e2ab83 /linux/drivers/media
parent1342dc3012002c994885d1ad6efd6c819fa2805e (diff)
downloadmediapointer-dvb-s2-e8c1796efb04c2a4423fc2367b7ae13d3e71f488.tar.gz
mediapointer-dvb-s2-e8c1796efb04c2a4423fc2367b7ae13d3e71f488.tar.bz2
v4l2-dev: make the video_device's release callback mandatory
From: Hans Verkuil <hverkuil@xs4all.nl> Now that all drivers set the release callback in the video_device struct we can put in a BUG_ON in video_register_device to ensure that the callback is always there. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r--linux/drivers/media/video/v4l2-dev.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/linux/drivers/media/video/v4l2-dev.c b/linux/drivers/media/video/v4l2-dev.c
index 0a4f9085b..e6ae35df2 100644
--- a/linux/drivers/media/video/v4l2-dev.c
+++ b/linux/drivers/media/video/v4l2-dev.c
@@ -106,11 +106,6 @@ static void video_release(struct device *cd)
{
struct video_device *vfd = container_of(cd, struct video_device, dev);
-#if 1 /* keep */
- /* needed until all drivers are fixed */
- if (!vfd->release)
- return;
-#endif
vfd->release(vfd);
}
@@ -271,6 +266,9 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
int ret;
char *name_base;
+ /* the release callback MUST be present */
+ BUG_ON(!vfd->release);
+
switch (type) {
case VFL_TYPE_GRABBER:
base = MINOR_VFL_TYPE_GRABBER_MIN;
@@ -369,13 +367,6 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
}
#endif
-#if 1 /* keep */
- /* needed until all drivers are fixed */
- if (!vfd->release)
- printk(KERN_WARNING "videodev: \"%s\" has no release callback. "
- "Please fix your driver for proper sysfs support, see "
- "http://lwn.net/Articles/36850/\n", vfd->name);
-#endif
return 0;
fail_minor: