Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Brownell and committed by
Jean Delvare
26386763 104cb574

+8 -1
+8 -1
include/linux/i2c.h
··· 271 271 * This is done at arch_initcall time, before declaring any i2c adapters. 272 272 * Modules for add-on boards must use other calls. 273 273 */ 274 + #ifdef CONFIG_I2C_BOARDINFO 274 275 extern int 275 276 i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsigned n); 276 - 277 + #else 278 + static inline int 279 + i2c_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 286 * The following structs are for those who like to implement new bus drivers: