diff options
author | Marco Felsch <m.felsch@pengutronix.de> | 2018-10-18 12:19:31 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-10-19 13:54:36 +0200 |
commit | d8fcbad91a22be905b5fd8aec26ce1cc3b950d98 (patch) | |
tree | 9a9b9bbd795a5316966ea82b1349c75098e9dacb /drivers/i2c | |
parent | 891098f3bf12f90524cc0f5e7694a450e0c11f7f (diff) | |
download | barebox-d8fcbad91a22be905b5fd8aec26ce1cc3b950d98.tar.gz barebox-d8fcbad91a22be905b5fd8aec26ce1cc3b950d98.tar.xz |
i2c: introduce device_i2c_driver() macro
Add macro and dependency to avoid boilerplate code. Since now simple
i2c drivers only have to include the i2c.h header and call the
device_i2c_driver() macro to register a i2c device driver.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-pca954x.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/i2c/muxes/i2c-mux-pca954x.c b/drivers/i2c/muxes/i2c-mux-pca954x.c index 395254cdca..d397e803b1 100644 --- a/drivers/i2c/muxes/i2c-mux-pca954x.c +++ b/drivers/i2c/muxes/i2c-mux-pca954x.c @@ -44,7 +44,6 @@ #include <i2c/i2c.h> #include <i2c/i2c-algo-bit.h> #include <i2c/i2c-mux.h> -#include <init.h> #include <gpio.h> #include <of_gpio.h> @@ -248,12 +247,7 @@ static struct driver_d pca954x_driver = { .probe = pca954x_probe, .id_table = pca954x_id, }; - -static int __init pca954x_init(void) -{ - return i2c_driver_register(&pca954x_driver); -} -device_initcall(pca954x_init); +device_i2c_driver(pca954x_driver); MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); MODULE_DESCRIPTION("PCA954x I2C mux/switch driver"); |