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/stmpe-i2c.c | |
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/stmpe-i2c.c')
-rw-r--r-- | drivers/mfd/stmpe-i2c.c | 10 |
1 files changed, 1 insertions, 9 deletions
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); |