[PATCH 7/7] regulator: act8865: Init at subsys level
From: Maarten ter Huurne
Date: Sun Feb 28 2016 - 10:54:24 EST
Since the defined regulators are used in other drivers, we can avoid
deferred probing by registering this driver sooner.
Signed-off-by: Maarten ter Huurne <maarten@xxxxxxxxxxxxxx>
---
drivers/regulator/act8865-regulator.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/act8865-regulator.c b/drivers/regulator/act8865-regulator.c
index 48608e2..6a0d34f 100644
--- a/drivers/regulator/act8865-regulator.c
+++ b/drivers/regulator/act8865-regulator.c
@@ -686,7 +686,17 @@ static struct i2c_driver act8865_pmic_driver = {
.id_table = act8865_ids,
};
-module_i2c_driver(act8865_pmic_driver);
+static int __init act8865_pmic_driver_init(void)
+{
+ return i2c_add_driver(&act8865_pmic_driver);
+}
+subsys_initcall(act8865_pmic_driver_init);
+
+static void __exit act8865_pmic_driver_exit(void)
+{
+ i2c_del_driver(&act8865_pmic_driver);
+}
+module_exit(act8865_pmic_driver_exit);
MODULE_DESCRIPTION("active-semi act88xx voltage regulator driver");
MODULE_AUTHOR("Wenyou Yang <wenyou.yang@xxxxxxxxx>");
--
2.6.2