Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9254475bbfbed5f0596d952c6a3c9806e19dd0b
Commit:     a9254475bbfbed5f0596d952c6a3c9806e19dd0b
Parent:     1309d4e68497184d2fd87e892ddf14076c2bda98
Author:     Mauro Carvalho Chehab <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 29 18:32:35 2008 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Mon Feb 18 11:14:50 2008 -0300

    V4L/DVB (7115): Fix bug #9833: regression when compiling V4L without I2C
    
    Adrian Bunk reported:
    
    > > Commit 8ffbc6559493c64d6194c92d856196fdaeb8a5fb causes the following
    > > compile error with CONFIG_VIDEO_DEV=y/m, CONFIG_I2C=n:
    > >
    > > <--  snip  -->
    > >
    > > ...
    > >   MODPOST 26 modules
    > > ERROR: "i2c_attach_client" [drivers/media/video/v4l2-common.ko] 
undefined!
    > > make[2]: *** [__modpost] Error 1
    > >
    > > <--  snip  -->
    
    ...
    
    And what should happen if CONFIG_VIDEO_DEV=y, CONFIG_I2C=m?
    
    CC: Adrian Bunk <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/Kconfig             |    5 ++++
 drivers/media/video/Makefile      |    5 ++-
 drivers/media/video/v4l2-common.c |   38 +++++++++++++++---------------------
 3 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig
index 8f4a453..707b20d 100644
--- a/drivers/media/Kconfig
+++ b/drivers/media/Kconfig
@@ -25,6 +25,11 @@ config VIDEO_DEV
          To compile this driver as a module, choose M here: the
          module will be called videodev.
 
+config VIDEO_V4L2_COMMON
+       tristate
+       depends on (I2C || I2C=n) && VIDEO_DEV
+       default (I2C || I2C=n) && VIDEO_DEV
+
 config VIDEO_V4L1
        bool "Enable Video For Linux API 1 (DEPRECATED)"
        depends on VIDEO_DEV
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index 850b8c6..3f209b3 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -10,8 +10,9 @@ msp3400-objs  :=      msp3400-driver.o msp3400-kthreads.o
 
 stkwebcam-objs :=      stk-webcam.o stk-sensor.o
 
-obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o \
-                          v4l2-int-device.o
+obj-$(CONFIG_VIDEO_DEV) += videodev.o compat_ioctl32.o v4l2-int-device.o
+
+obj-$(CONFIG_VIDEO_V4L2_COMMON) += v4l2-common.o
 
 ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y)
   obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o
diff --git a/drivers/media/video/v4l2-common.c 
b/drivers/media/video/v4l2-common.c
index c056ff6..74d0a59 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -973,6 +973,18 @@ u32 v4l2_ctrl_next(const u32 * const * ctrl_classes, u32 
id)
        return **ctrl_classes;
 }
 
+int v4l2_chip_match_host(u32 match_type, u32 match_chip)
+{
+       switch (match_type) {
+       case V4L2_CHIP_MATCH_HOST:
+               return match_chip == 0;
+       default:
+               return 0;
+       }
+}
+EXPORT_SYMBOL(v4l2_chip_match_host);
+
+#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
 int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 
match_chip)
 {
        switch (match_type) {
@@ -984,6 +996,7 @@ int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 
match_type, u32 match_c
                return 0;
        }
 }
+EXPORT_SYMBOL(v4l2_chip_match_i2c_client);
 
 int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident 
*chip,
                u32 ident, u32 revision)
@@ -1000,16 +1013,7 @@ int v4l2_chip_ident_i2c_client(struct i2c_client *c, 
struct v4l2_chip_ident *chi
        }
        return 0;
 }
-
-int v4l2_chip_match_host(u32 match_type, u32 match_chip)
-{
-       switch (match_type) {
-       case V4L2_CHIP_MATCH_HOST:
-               return match_chip == 0;
-       default:
-               return 0;
-       }
-}
+EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
 
 /* ----------------------------------------------------------------- */
 
@@ -1038,6 +1042,8 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int 
address, struct i2c_driver
        }
        return err != -ENOMEM ? 0 : err;
 }
+EXPORT_SYMBOL(v4l2_i2c_attach);
+#endif
 
 /* ----------------------------------------------------------------- */
 
@@ -1061,15 +1067,3 @@ EXPORT_SYMBOL(v4l2_ctrl_get_menu);
 EXPORT_SYMBOL(v4l2_ctrl_query_menu);
 EXPORT_SYMBOL(v4l2_ctrl_query_fill);
 EXPORT_SYMBOL(v4l2_ctrl_query_fill_std);
-
-EXPORT_SYMBOL(v4l2_chip_match_i2c_client);
-EXPORT_SYMBOL(v4l2_chip_ident_i2c_client);
-EXPORT_SYMBOL(v4l2_chip_match_host);
-
-EXPORT_SYMBOL(v4l2_i2c_attach);
-
-/*
- * Local variables:
- * c-basic-offset: 8
- * End:
- */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to