From: David Brownell Date: Sun, 24 Feb 2008 19:03:42 +0000 (+0100) Subject: i2c: Make i2c_register_board_info() a NOP when CONFIG_I2C_BOARDINFO=n X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=263867631ea02741baf878ca9faaf94b1563b9d7;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Jean Delvare --- 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 *); * This is done at arch_initcall time, before declaring any i2c adapters. * Modules for add-on boards must use other calls. */ +#ifdef CONFIG_I2C_BOARDINFO 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 /* * The following structs are for those who like to implement new bus drivers: