diff options
Diffstat (limited to 'include/linux/i2c.h')
| -rw-r--r-- | include/linux/i2c.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 07d103a06d6..8e25a9167f1 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -482,6 +482,19 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
| 482 | { | 482 | { |
| 483 | return adap->nr; | 483 | return adap->nr; |
| 484 | } | 484 | } |
| 485 | |||
| 486 | /** | ||
| 487 | * module_i2c_driver() - Helper macro for registering a I2C driver | ||
| 488 | * @__i2c_driver: i2c_driver struct | ||
| 489 | * | ||
| 490 | * Helper macro for I2C drivers which do not do anything special in module | ||
| 491 | * init/exit. This eliminates a lot of boilerplate. Each module may only | ||
| 492 | * use this macro once, and calling it replaces module_init() and module_exit() | ||
| 493 | */ | ||
| 494 | #define module_i2c_driver(__i2c_driver) \ | ||
| 495 | module_driver(__i2c_driver, i2c_add_driver, \ | ||
| 496 | i2c_del_driver) | ||
| 497 | |||
| 485 | #endif /* I2C */ | 498 | #endif /* I2C */ |
| 486 | #endif /* __KERNEL__ */ | 499 | #endif /* __KERNEL__ */ |
| 487 | 500 | ||
