Skip to content

Commit 883071c

Browse files
committed
cpufreq: mvebu: Remove OPPs using dev_pm_opp_remove()
dev_pm_opp_cpumask_remove_table() is going to change in the next commit and will not remove dynamic OPPs automatically. They must be removed with a call to dev_pm_opp_remove(). Reviewed-by: Gregory CLEMENT <gregory.clement@bootlin.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
1 parent d0e8ae6 commit 883071c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

drivers/cpufreq/mvebu-cpufreq.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
8484

8585
ret = dev_pm_opp_add(cpu_dev, clk_get_rate(clk) / 2, 0);
8686
if (ret) {
87+
dev_pm_opp_remove(cpu_dev, clk_get_rate(clk));
8788
clk_put(clk);
8889
dev_err(cpu_dev, "Failed to register OPPs\n");
89-
goto opp_register_failed;
90+
return ret;
9091
}
9192

9293
ret = dev_pm_opp_set_sharing_cpus(cpu_dev,
@@ -99,11 +100,5 @@ static int __init armada_xp_pmsu_cpufreq_init(void)
99100

100101
platform_device_register_simple("cpufreq-dt", -1, NULL, 0);
101102
return 0;
102-
103-
opp_register_failed:
104-
/* As registering has failed remove all the opp for all cpus */
105-
dev_pm_opp_cpumask_remove_table(cpu_possible_mask);
106-
107-
return ret;
108103
}
109104
device_initcall(armada_xp_pmsu_cpufreq_init);

0 commit comments

Comments
 (0)