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/mfd | |
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/mfd')
-rw-r--r-- | drivers/mfd/act8846.c | 10 | ||||
-rw-r--r-- | drivers/mfd/da9053.c | 10 | ||||
-rw-r--r-- | drivers/mfd/da9063.c | 9 | ||||
-rw-r--r-- | drivers/mfd/lp3972.c | 10 | ||||
-rw-r--r-- | drivers/mfd/mc34704.c | 9 | ||||
-rw-r--r-- | drivers/mfd/mc9sdz60.c | 10 | ||||
-rw-r--r-- | drivers/mfd/stmpe-i2c.c | 10 | ||||
-rw-r--r-- | drivers/mfd/twl4030.c | 10 | ||||
-rw-r--r-- | drivers/mfd/twl6030.c | 10 |
9 files changed, 9 insertions, 79 deletions
diff --git a/drivers/mfd/act8846.c b/drivers/mfd/act8846.c index dfca0498b1..53ab70f5cc 100644 --- a/drivers/mfd/act8846.c +++ b/drivers/mfd/act8846.c @@ -18,7 +18,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -144,11 +143,4 @@ static struct driver_d act8846_driver = { .name = DRIVERNAME, .probe = act8846_probe, }; - -static int act8846_init(void) -{ - i2c_driver_register(&act8846_driver); - return 0; -} - -device_initcall(act8846_init); +device_i2c_driver(act8846_driver); diff --git a/drivers/mfd/da9053.c b/drivers/mfd/da9053.c index c706082a8b..b156bf113f 100644 --- a/drivers/mfd/da9053.c +++ b/drivers/mfd/da9053.c @@ -15,7 +15,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -310,11 +309,4 @@ static struct driver_d da9053_driver = { .probe = da9053_probe, .of_compatible = DRV_OF_COMPAT(da9053_dt_ids), }; - -static int da9053_init(void) -{ - i2c_driver_register(&da9053_driver); - return 0; -} - -device_initcall(da9053_init); +device_i2c_driver(da9053_driver); diff --git a/drivers/mfd/da9063.c b/drivers/mfd/da9063.c index 0c27bf495f..b6114a614b 100644 --- a/drivers/mfd/da9063.c +++ b/drivers/mfd/da9063.c @@ -16,7 +16,6 @@ #include <common.h> #include <driver.h> #include <restart.h> -#include <init.h> #include <i2c/i2c.h> #include <malloc.h> #include <notifier.h> @@ -297,10 +296,4 @@ static struct driver_d da9063_driver = { .id_table = da9063_id, .of_compatible = DRV_OF_COMPAT(da906x_dt_ids), }; - -static int da9063_init(void) -{ - return i2c_driver_register(&da9063_driver); -} - -device_initcall(da9063_init); +device_i2c_driver(da9063_driver); diff --git a/drivers/mfd/lp3972.c b/drivers/mfd/lp3972.c index 054713b942..42b28070ad 100644 --- a/drivers/mfd/lp3972.c +++ b/drivers/mfd/lp3972.c @@ -17,7 +17,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -96,11 +95,4 @@ static struct driver_d lp_driver = { .name = DRIVERNAME, .probe = lp_probe, }; - -static int lp_init(void) -{ - i2c_driver_register(&lp_driver); - return 0; -} - -device_initcall(lp_init); +device_i2c_driver(lp_driver); diff --git a/drivers/mfd/mc34704.c b/drivers/mfd/mc34704.c index bfda169aaa..f15f37ef6e 100644 --- a/drivers/mfd/mc34704.c +++ b/drivers/mfd/mc34704.c @@ -17,7 +17,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -133,10 +132,4 @@ static struct driver_d mc34704_driver = { .probe = mc34704_probe, .of_compatible = DRV_OF_COMPAT(mc34704_dt_ids), }; - -static int mc34704_init(void) -{ - i2c_driver_register(&mc34704_driver); - return 0; -} -device_initcall(mc34704_init); +device_i2c_driver(mc34704_driver); diff --git a/drivers/mfd/mc9sdz60.c b/drivers/mfd/mc9sdz60.c index 9993efc5de..2cb38d9784 100644 --- a/drivers/mfd/mc9sdz60.c +++ b/drivers/mfd/mc9sdz60.c @@ -16,7 +16,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -139,11 +138,4 @@ static struct driver_d mc_driver = { .name = DRIVERNAME, .probe = mc_probe, }; - -static int mc_init(void) -{ - i2c_driver_register(&mc_driver); - return 0; -} - -device_initcall(mc_init); +device_i2c_driver(mc_driver); diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c index 51c56bbf56..084e4b43bb 100644 --- a/drivers/mfd/stmpe-i2c.c +++ b/drivers/mfd/stmpe-i2c.c @@ -15,7 +15,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -173,11 +172,4 @@ static struct driver_d stmpe_driver = { .probe = stmpe_probe, .id_table = stmpe_i2c_id, }; - -static int stmpe_init(void) -{ - i2c_driver_register(&stmpe_driver); - return 0; -} - -device_initcall(stmpe_init); +device_i2c_driver(stmpe_driver); diff --git a/drivers/mfd/twl4030.c b/drivers/mfd/twl4030.c index 3b4c661a87..cf33efbd89 100644 --- a/drivers/mfd/twl4030.c +++ b/drivers/mfd/twl4030.c @@ -6,7 +6,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -50,11 +49,4 @@ static struct driver_d twl_driver = { .name = DRIVERNAME, .probe = twl_probe, }; - -static int twl_init(void) -{ - i2c_driver_register(&twl_driver); - return 0; -} - -device_initcall(twl_init); +device_i2c_driver(twl_driver); diff --git a/drivers/mfd/twl6030.c b/drivers/mfd/twl6030.c index 0645d3c4db..0a244de077 100644 --- a/drivers/mfd/twl6030.c +++ b/drivers/mfd/twl6030.c @@ -5,7 +5,6 @@ */ #include <common.h> -#include <init.h> #include <driver.h> #include <xfuncs.h> #include <errno.h> @@ -67,11 +66,4 @@ static struct driver_d twl_driver = { .name = DRIVERNAME, .probe = twl_probe, }; - -static int twl_init(void) -{ - i2c_driver_register(&twl_driver); - return 0; -} - -device_initcall(twl_init); +device_i2c_driver(twl_driver); |