[PATCH 12/36] i2c: Add a no-op i2c_register_board_info if i2c is disabled

Sascha Hauer s.hauer at pengutronix.de
Fri Dec 18 10:48:01 EST 2009


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 include/i2c/i2c.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/i2c/i2c.h b/include/i2c/i2c.h
index 991dd5b..3e9d2b4 100644
--- a/include/i2c/i2c.h
+++ b/include/i2c/i2c.h
@@ -110,7 +110,15 @@ struct i2c_board_info {
 #define I2C_BOARD_INFO(dev_type, dev_addr) \
 	.type = dev_type, .addr = (dev_addr)
 
+#ifdef CONFIG_I2C
 extern int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n);
+#else
+static inline int i2c_register_board_info(int busnum,
+		struct i2c_board_info const *info, unsigned n)
+{
+	return 0;
+}
+#endif
 extern int i2c_add_numbered_adapter(struct i2c_adapter *adapter);
 
 extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num);
-- 
1.6.5.2




More information about the barebox mailing list