From be7429ae4e85a58c85c22070fa87d42825a8018a Mon Sep 17 00:00:00 2001 From: Tao Huang Date: Sun, 26 Apr 2020 20:38:09 +0800 Subject: [PATCH] regulator: pwm: Call pwm_regulator_driver_init() early when CONFIG_ROCKCHIP_THUNDER_BOOT=y Regulator init on subsys_initcall_sync level. Change-Id: I477e8282dfb4582ac29f1b789a286c5d5ed7c60c Signed-off-by: Tao Huang --- drivers/regulator/pwm-regulator.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index a2fd140eff81..2a3aafd25b35 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -410,7 +410,21 @@ static struct platform_driver pwm_regulator_driver = { .probe = pwm_regulator_probe, }; +#ifdef CONFIG_ROCKCHIP_THUNDER_BOOT +static int __init pwm_regulator_driver_init(void) +{ + return platform_driver_register(&pwm_regulator_driver); +} +subsys_initcall_sync(pwm_regulator_driver_init); + +static void __exit pwm_regulator_driver_exit(void) +{ + platform_driver_unregister(&pwm_regulator_driver); +} +module_exit(pwm_regulator_driver_exit); +#else module_platform_driver(pwm_regulator_driver); +#endif MODULE_LICENSE("GPL"); MODULE_AUTHOR("Lee Jones ");