diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-08-23 06:27:59 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 09:36:54 -0200 |
commit | d6e7497eaf9889d39a070f60309a9bcea1fd29f6 (patch) | |
tree | a0668d21b89c749d1a193bac26c9961bd409e1af | |
parent | aa5e90af7d78d1711f8f4275ce3638817c0023dc (diff) |
V4L/DVB (8784): v4l2-dev: make the video_device's release callback mandatory
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.
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 | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index fda48a2efda..ff219df4b72 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -84,11 +84,6 @@ static void video_release(struct device *cd) { struct video_device *vfd = container_of(cd, struct video_device, dev); -#if 1 - /* needed until all drivers are fixed */ - if (!vfd->release) - return; -#endif vfd->release(vfd); } @@ -233,8 +228,8 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, int ret; char *name_base; - if (vfd == NULL) - return -EINVAL; + /* the release callback MUST be present */ + BUG_ON(!vfd->release); if (vfd == NULL) return -EINVAL; @@ -312,13 +307,6 @@ int video_register_device_index(struct video_device *vfd, int type, int nr, goto fail_minor; } -#if 1 - /* 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: |