dtpm/soc/rk3399: Add the ability to unload the module
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Sun, 30 Jan 2022 21:02:09 +0000 (22:02 +0100)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Wed, 23 Feb 2022 18:46:29 +0000 (19:46 +0100)
The dtpm hierarchy can now be removed with the
dtpm_destroy_hierarchy() function. Add the module_exit() callback so
the module can be unloaded by removing the previously created
hierarchy.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Link: https://lore.kernel.org/r/20220130210210.549877-7-daniel.lezcano@linaro.org
drivers/soc/rockchip/dtpm.c

index ebebb748488b7f8d2d44e6d243f6f8be26db474c..5a23784b52215e4c850eaae7dc6122c711bbec3d 100644 (file)
@@ -52,6 +52,12 @@ static int __init rockchip_dtpm_init(void)
 }
 module_init(rockchip_dtpm_init);
 
+static void __exit rockchip_dtpm_exit(void)
+{
+       return dtpm_destroy_hierarchy();
+}
+module_exit(rockchip_dtpm_exit);
+
 MODULE_SOFTDEP("pre: panfrost cpufreq-dt");
 MODULE_DESCRIPTION("Rockchip DTPM driver");
 MODULE_LICENSE("GPL");