Skip to contentSkip to conversation

Fix of_i2c include for module compilation

PATCH Superseded Jochen Friedrich 2 participants 3 messages May 3, 2008 – May 6, 2008

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix of_i2c include for module compilation

Now that of_i2c may be compiled as module, the header must be exported for module compilation, as well.

---
 include/linux/of_i2c.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/linux/of_i2c.h +1 -1
index 2e5a967..dca6013 100644
@@ -14,7 +14,7 @@
 
 #include <linux/i2c.h>
 
-#ifdef CONFIG_OF_I2C
+#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
 
 void of_register_i2c_devices(struct i2c_adapter *adap,
 			     struct device_node *adap_node);
Signature · 1 line
1.5.5.1
#1 lore raw

include/linux/of_i2c.h line 20

Quoted 5 lines · Jochen Friedrich
include/linux/of_i2c.h +1 -1
-#ifdef CONFIG_OF_I2C
+#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
 
 void of_register_i2c_devices(struct i2c_adapter *adap,
 			     struct device_node *adap_node);

Why do we have that ifdef there at all? There's only that one external declaration within it, so the #ifdef and #endif could just be removed. If the ifdef hadn't been there in the first place we wouldn't have had this problem.

Paul.

#2 lore raw

Hi Paul,

Quoted 10 lines

include/linux/of_i2c.h line 20

Quoted 5 lines
include/linux/of_i2c.h +1 -1
-#ifdef CONFIG_OF_I2C
+#if defined(CONFIG_OF_I2C) || defined(CONFIG_OF_I2C_MODULE)
 
 void of_register_i2c_devices(struct i2c_adapter *adap,
 			     struct device_node *adap_node);

Why do we have that ifdef there at all? There's only that one external declaration within it, so the #ifdef and #endif could just be removed. If the ifdef hadn't been there in the first place we wouldn't have had this problem.

You're right. I mainly copied from of_gpio.h without too much thinking :(. I'll resend.

Thanks,
Jochen