aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-23 05:27:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:54 -0400
commitd6e7497eaf9889d39a070f60309a9bcea1fd29f6 (patch)
treea0668d21b89c749d1a193bac26c9961bd409e1af /drivers/media
parentaa5e90af7d78d1711f8f4275ce3638817c0023dc (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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/v4l2-dev.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index fda48a2efda6..ff219df4b725 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)
84{ 84{
85 struct video_device *vfd = container_of(cd, struct video_device, dev); 85 struct video_device *vfd = container_of(cd, struct video_device, dev);
86 86
87#if 1
88 /* needed until all drivers are fixed */
89 if (!vfd->release)
90 return;
91#endif
92 vfd->release(vfd); 87 vfd->release(vfd);
93} 88}
94 89
@@ -233,8 +228,8 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
233 int ret; 228 int ret;
234 char *name_base; 229 char *name_base;
235 230
236 if (vfd == NULL) 231 /* the release callback MUST be present */
237 return -EINVAL; 232 BUG_ON(!vfd->release);
238 233
239 if (vfd == NULL) 234 if (vfd == NULL)
240 return -EINVAL; 235 return -EINVAL;
@@ -312,13 +307,6 @@ int video_register_device_index(struct video_device *vfd, int type, int nr,
312 goto fail_minor; 307 goto fail_minor;
313 } 308 }
314 309
315#if 1
316 /* needed until all drivers are fixed */
317 if (!vfd->release)
318 printk(KERN_WARNING "videodev: \"%s\" has no release callback. "
319 "Please fix your driver for proper sysfs support, see "
320 "http://lwn.net/Articles/36850/\n", vfd->name);
321#endif
322 return 0; 310 return 0;
323 311
324fail_minor: 312fail_minor: