From e8c1796efb04c2a4423fc2367b7ae13d3e71f488 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 23 Aug 2008 11:27:59 +0200 Subject: v4l2-dev: make the video_device's release callback mandatory From: Hans Verkuil 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 --- linux/drivers/media/video/v4l2-dev.c | 15 +++------------ 1 file 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: -- cgit v1.2.3