diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-29 16:32:35 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-02-18 09:14:50 -0500 |
commit | a9254475bbfbed5f0596d952c6a3c9806e19dd0b (patch) | |
tree | f397e0332af0e2326e23a2f27db86c2262c5e755 /drivers/media/video/v4l2-common.c | |
parent | 1309d4e68497184d2fd87e892ddf14076c2bda98 (diff) |
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 <bunk@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/v4l2-common.c')
-rw-r--r-- | drivers/media/video/v4l2-common.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index c056ff6d810c..74d0a5996697 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) | |||
973 | return **ctrl_classes; | 973 | return **ctrl_classes; |
974 | } | 974 | } |
975 | 975 | ||
976 | int v4l2_chip_match_host(u32 match_type, u32 match_chip) | ||
977 | { | ||
978 | switch (match_type) { | ||
979 | case V4L2_CHIP_MATCH_HOST: | ||
980 | return match_chip == 0; | ||
981 | default: | ||
982 | return 0; | ||
983 | } | ||
984 | } | ||
985 | EXPORT_SYMBOL(v4l2_chip_match_host); | ||
986 | |||
987 | #if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE)) | ||
976 | int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_chip) | 988 | int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_chip) |
977 | { | 989 | { |
978 | switch (match_type) { | 990 | switch (match_type) { |
@@ -984,6 +996,7 @@ int v4l2_chip_match_i2c_client(struct i2c_client *c, u32 match_type, u32 match_c | |||
984 | return 0; | 996 | return 0; |
985 | } | 997 | } |
986 | } | 998 | } |
999 | EXPORT_SYMBOL(v4l2_chip_match_i2c_client); | ||
987 | 1000 | ||
988 | int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, | 1001 | int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chip, |
989 | u32 ident, u32 revision) | 1002 | u32 ident, u32 revision) |
@@ -1000,16 +1013,7 @@ int v4l2_chip_ident_i2c_client(struct i2c_client *c, struct v4l2_chip_ident *chi | |||
1000 | } | 1013 | } |
1001 | return 0; | 1014 | return 0; |
1002 | } | 1015 | } |
1003 | 1016 | EXPORT_SYMBOL(v4l2_chip_ident_i2c_client); | |
1004 | int v4l2_chip_match_host(u32 match_type, u32 match_chip) | ||
1005 | { | ||
1006 | switch (match_type) { | ||
1007 | case V4L2_CHIP_MATCH_HOST: | ||
1008 | return match_chip == 0; | ||
1009 | default: | ||
1010 | return 0; | ||
1011 | } | ||
1012 | } | ||
1013 | 1017 | ||
1014 | /* ----------------------------------------------------------------- */ | 1018 | /* ----------------------------------------------------------------- */ |
1015 | 1019 | ||
@@ -1038,6 +1042,8 @@ int v4l2_i2c_attach(struct i2c_adapter *adapter, int address, struct i2c_driver | |||
1038 | } | 1042 | } |
1039 | return err != -ENOMEM ? 0 : err; | 1043 | return err != -ENOMEM ? 0 : err; |
1040 | } | 1044 | } |
1045 | EXPORT_SYMBOL(v4l2_i2c_attach); | ||
1046 | #endif | ||
1041 | 1047 | ||
1042 | /* ----------------------------------------------------------------- */ | 1048 | /* ----------------------------------------------------------------- */ |
1043 | 1049 | ||
@@ -1061,15 +1067,3 @@ EXPORT_SYMBOL(v4l2_ctrl_get_menu); | |||
1061 | EXPORT_SYMBOL(v4l2_ctrl_query_menu); | 1067 | EXPORT_SYMBOL(v4l2_ctrl_query_menu); |
1062 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); | 1068 | EXPORT_SYMBOL(v4l2_ctrl_query_fill); |
1063 | EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); | 1069 | EXPORT_SYMBOL(v4l2_ctrl_query_fill_std); |
1064 | |||
1065 | EXPORT_SYMBOL(v4l2_chip_match_i2c_client); | ||
1066 | EXPORT_SYMBOL(v4l2_chip_ident_i2c_client); | ||
1067 | EXPORT_SYMBOL(v4l2_chip_match_host); | ||
1068 | |||
1069 | EXPORT_SYMBOL(v4l2_i2c_attach); | ||
1070 | |||
1071 | /* | ||
1072 | * Local variables: | ||
1073 | * c-basic-offset: 8 | ||
1074 | * End: | ||
1075 | */ | ||