aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/i2c.h
diff options
context:
space:
mode:
authorDavid Brownell <david-b@pacbell.net>2008-02-24 14:03:42 -0500
committerJean Delvare <khali@hyperion.delvare>2008-02-24 14:03:42 -0500
commit263867631ea02741baf878ca9faaf94b1563b9d7 (patch)
tree11875248c5115517ca1b328a630030461f0d00b1 /include/linux/i2c.h
parent104cb574feb3033299568483a3f68031f47e0d43 (diff)
i2c: Make i2c_register_board_info() a NOP when CONFIG_I2C_BOARDINFO=n
Don't require platform code to be #ifdeffed according to whether I2C is enabled or not ... if it's not enabled, let GCC compile out all I2C device declarations. (Issue noted on an NSLU2 build that didn't configure I2C.) Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'include/linux/i2c.h')
-rw-r--r--include/linux/i2c.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 2d1c608eb5db..365e0df3646b 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -271,9 +271,16 @@ extern void i2c_unregister_device(struct i2c_client *);
271 * This is done at arch_initcall time, before declaring any i2c adapters. 271 * This is done at arch_initcall time, before declaring any i2c adapters.
272 * Modules for add-on boards must use other calls. 272 * Modules for add-on boards must use other calls.
273 */ 273 */
274#ifdef CONFIG_I2C_BOARDINFO
274extern int 275extern int
275i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n); 276i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n);
276 277#else
278static inline int
279i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n)
280{
281 return 0;
282}
283#endif
277 284
278/* 285/*
279 * The following structs are for those who like to implement new bus drivers: 286 * The following structs are for those who like to implement new bus drivers: