diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-11-25 05:34:21 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-11-30 20:49:33 -0500 |
commit | 2f0f609f2e3b874e8acf895459939903e6574d9c (patch) | |
tree | aa54f3a7cda471bd6cf17cd887d4342587dcdf87 /drivers/cpufreq | |
parent | 2af3411f0e559914b8c6e289ed287e166fd502d7 (diff) |
cpufreq-dt: free OPP table created during ->init()
OPP layer now supports freeing of OPPs and we should free them once they aren't
useful anymore.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Tested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r-- | drivers/cpufreq/cpufreq-dt.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index e720954244b1..9bc2720628a4 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c | |||
@@ -214,7 +214,7 @@ static int cpufreq_init(struct cpufreq_policy *policy) | |||
214 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 214 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
215 | if (!priv) { | 215 | if (!priv) { |
216 | ret = -ENOMEM; | 216 | ret = -ENOMEM; |
217 | goto out_put_node; | 217 | goto out_free_opp; |
218 | } | 218 | } |
219 | 219 | ||
220 | of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance); | 220 | of_property_read_u32(np, "voltage-tolerance", &priv->voltage_tolerance); |
@@ -294,7 +294,8 @@ out_free_cpufreq_table: | |||
294 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); | 294 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table); |
295 | out_free_priv: | 295 | out_free_priv: |
296 | kfree(priv); | 296 | kfree(priv); |
297 | out_put_node: | 297 | out_free_opp: |
298 | of_free_opp_table(cpu_dev); | ||
298 | of_node_put(np); | 299 | of_node_put(np); |
299 | out_put_reg_clk: | 300 | out_put_reg_clk: |
300 | clk_put(cpu_clk); | 301 | clk_put(cpu_clk); |
@@ -311,6 +312,7 @@ static int cpufreq_exit(struct cpufreq_policy *policy) | |||
311 | if (priv->cdev) | 312 | if (priv->cdev) |
312 | cpufreq_cooling_unregister(priv->cdev); | 313 | cpufreq_cooling_unregister(priv->cdev); |
313 | dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); | 314 | dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); |
315 | of_free_opp_table(priv->cpu_dev); | ||
314 | clk_put(policy->clk); | 316 | clk_put(policy->clk); |
315 | if (!IS_ERR(priv->cpu_reg)) | 317 | if (!IS_ERR(priv->cpu_reg)) |
316 | regulator_put(priv->cpu_reg); | 318 | regulator_put(priv->cpu_reg); |