]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
V4L: v4l2-common: remove incorrect MODULE test
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 31 Mar 2009 13:23:04 +0000 (09:23 -0400)
committerChris Wright <chrisw@sous-sol.org>
Thu, 2 Apr 2009 20:55:20 +0000 (13:55 -0700)
upstream commit: d64260d58865004c6354e024da3450fdd607ea07

v4l2-common doesn't have to be a module for it to call request_module().
Just remove that test.

Without this patch loading ivtv as a module while v4l2-common is compiled
into the kernel will cause a delayed load of the i2c modules that ivtv
needs since request_module is never called directly.

While it is nice to see the delayed load in action, it is not so nice in
that ivtv fails to do a lot of necessary i2c initializations and will oops
later on with a division-by-zero.

Thanks to Mark Lord for reporting this and helping me figure out what was
wrong.

Thanks-to: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Thanks-to: Mark Lord <lkml@rtr.ca>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/media/video/v4l2-common.c

index b8f2be8d5c0ee3702bad5f880180797e711082f9..907cd029a5370d9df26061b4b44ed3de6fe735d1 100644 (file)
@@ -910,10 +910,10 @@ struct v4l2_subdev *v4l2_i2c_new_subdev(struct i2c_adapter *adapter,
        struct i2c_board_info info;
 
        BUG_ON(!dev);
-#ifdef MODULE
+
        if (module_name)
                request_module(module_name);
-#endif
+
        /* Setup the i2c board info with the device type and
           the device address. */
        memset(&info, 0, sizeof(info));
@@ -958,10 +958,10 @@ struct v4l2_subdev *v4l2_i2c_new_probed_subdev(struct i2c_adapter *adapter,
        struct i2c_board_info info;
 
        BUG_ON(!dev);
-#ifdef MODULE
+
        if (module_name)
                request_module(module_name);
-#endif
+
        /* Setup the i2c board info with the device type and
           the device address. */
        memset(&info, 0, sizeof(info));