aboutsummaryrefslogtreecommitdiff
path: root/drivers/powercap/dtpm_cpu.c
diff options
context:
space:
mode:
authorDaniel Lezcano2022-01-30 22:02:08 +0100
committerDaniel Lezcano2022-02-23 19:46:25 +0100
commitbfded2ca8f36935ff13b3b30f8e66d6135e178ac (patch)
tree0560f15c68b4d07e5611d1ede99acc4a68067f5f /drivers/powercap/dtpm_cpu.c
parent4712a236db409d5ee5dccb8c7e57fe54d7d3ec66 (diff)
powercap/dtpm_cpu: Add exit function
Now that we can destroy the hierarchy, the code must remove what it had put in place at the creation. In our case, the cpu hotplug callbacks. 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-6-daniel.lezcano@linaro.org
Diffstat (limited to 'drivers/powercap/dtpm_cpu.c')
-rw-r--r--drivers/powercap/dtpm_cpu.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/powercap/dtpm_cpu.c b/drivers/powercap/dtpm_cpu.c
index 71f45d2f5a60..bca2f912d349 100644
--- a/drivers/powercap/dtpm_cpu.c
+++ b/drivers/powercap/dtpm_cpu.c
@@ -299,8 +299,15 @@ static int dtpm_cpu_init(void)
return 0;
}
+static void dtpm_cpu_exit(void)
+{
+ cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
+ cpuhp_remove_state_nocalls(CPUHP_AP_DTPM_CPU_DEAD);
+}
+
struct dtpm_subsys_ops dtpm_cpu_ops = {
.name = KBUILD_MODNAME,
.init = dtpm_cpu_init,
+ .exit = dtpm_cpu_exit,
.setup = dtpm_cpu_setup,
};