Commit 493b4cd2 authored by Viresh Kumar's avatar Viresh Kumar Committed by Rafael J. Wysocki

cpufreq: arm_big_little: 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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent cc87b8a8
...@@ -289,6 +289,8 @@ static void _put_cluster_clk_and_freq_table(struct device *cpu_dev) ...@@ -289,6 +289,8 @@ static void _put_cluster_clk_and_freq_table(struct device *cpu_dev)
clk_put(clk[cluster]); clk_put(clk[cluster]);
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]);
if (arm_bL_ops->free_opp_table)
arm_bL_ops->free_opp_table(cpu_dev);
dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster); dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster);
} }
...@@ -337,7 +339,7 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) ...@@ -337,7 +339,7 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev)
if (ret) { if (ret) {
dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n", dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n",
__func__, cpu_dev->id, ret); __func__, cpu_dev->id, ret);
goto out; goto free_opp_table;
} }
name[12] = cluster + '0'; name[12] = cluster + '0';
...@@ -354,6 +356,9 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) ...@@ -354,6 +356,9 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev)
ret = PTR_ERR(clk[cluster]); ret = PTR_ERR(clk[cluster]);
dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]);
free_opp_table:
if (arm_bL_ops->free_opp_table)
arm_bL_ops->free_opp_table(cpu_dev);
out: out:
dev_err(cpu_dev, "%s: Failed to get data for cluster: %d\n", __func__, dev_err(cpu_dev, "%s: Failed to get data for cluster: %d\n", __func__,
cluster); cluster);
......
...@@ -25,13 +25,16 @@ ...@@ -25,13 +25,16 @@
struct cpufreq_arm_bL_ops { struct cpufreq_arm_bL_ops {
char name[CPUFREQ_NAME_LEN]; char name[CPUFREQ_NAME_LEN];
int (*get_transition_latency)(struct device *cpu_dev);
/* /*
* This must set opp table for cpu_dev in a similar way as done by * This must set opp table for cpu_dev in a similar way as done by
* of_init_opp_table(). * of_init_opp_table().
*/ */
int (*init_opp_table)(struct device *cpu_dev); int (*init_opp_table)(struct device *cpu_dev);
/* Optional */
int (*get_transition_latency)(struct device *cpu_dev);
void (*free_opp_table)(struct device *cpu_dev);
}; };
int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops);
......
...@@ -82,6 +82,7 @@ static struct cpufreq_arm_bL_ops dt_bL_ops = { ...@@ -82,6 +82,7 @@ static struct cpufreq_arm_bL_ops dt_bL_ops = {
.name = "dt-bl", .name = "dt-bl",
.get_transition_latency = dt_get_transition_latency, .get_transition_latency = dt_get_transition_latency,
.init_opp_table = dt_init_opp_table, .init_opp_table = dt_init_opp_table,
.free_opp_table = of_free_opp_table,
}; };
static int generic_bL_probe(struct platform_device *pdev) static int generic_bL_probe(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment