The patch number 8784 was added via Hans Verkuil <[EMAIL PROTECTED]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        [EMAIL PROTECTED]

------

From: Hans Verkuil  <[EMAIL PROTECTED]>
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.

Priority: normal

Signed-off-by: Hans Verkuil <[EMAIL PROTECTED]>


---

 linux/drivers/media/video/v4l2-dev.c |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff -r b3048237447e -r cde8c3284529 linux/drivers/media/video/v4l2-dev.c
--- a/linux/drivers/media/video/v4l2-dev.c      Sat Aug 23 11:23:55 2008 +0200
+++ b/linux/drivers/media/video/v4l2-dev.c      Sat Aug 23 11:27:59 2008 +0200
@@ -106,11 +106,6 @@ static void video_release(struct device 
 {
        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);
 }
 
@@ -270,6 +265,9 @@ int video_register_device_index(struct v
        int end;
        int ret;
        char *name_base;
+
+       /* the release callback MUST be present */
+       BUG_ON(!vfd->release);
 
        switch (type) {
        case VFL_TYPE_GRABBER:
@@ -369,13 +367,6 @@ int video_register_device_index(struct v
        }
 #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:


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/cde8c3284529ed55895fce8486867b55c673d6da

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to