[PATCH] i2c: of: Fix of_i2c header file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the OF_I2C configure option is not enabled or not available like on
SPARC, the of_find_i2c_device_by_node and of_find_i2c_adapter_by_node
functions are not declared and can thus lead to compilation errors in
drivers using those.

Signed-off-by: Maxime Ripard <maxime.ripard@xxxxxxxxxxxxxxxxxx>
Reported-by: fengguang.wu@xxxxxxxxx
---
 include/linux/of_i2c.h |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/include/linux/of_i2c.h b/include/linux/of_i2c.h
index 1cb775f..f1ec7f7 100644
--- a/include/linux/of_i2c.h
+++ b/include/linux/of_i2c.h
@@ -29,6 +29,19 @@ static inline void of_i2c_register_devices(struct i2c_adapter *adap)
 {
 	return;
 }
+
+static inline
+struct i2c_client *of_find_i2c_device_by_node(struct device_node *node)
+{
+	return NULL;
+}
+
+static inline
+struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node)
+{
+	return NULL;
+}
+
 #endif /* CONFIG_OF_I2C */
 
 #endif /* __LINUX_OF_I2C_H */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux