diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-11-25 05:34:20 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-12-01 18:01:24 -0500 |
commit | 493b4cd285e68d8d8d5853a2536ea06f8cabeaeb (patch) | |
tree | 1bfd16d752e91131fdb009c87a53f73bbf8b6882 | |
parent | cc87b8a8e94d840863334151f3525fd286c9ae23 (diff) |
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/arm_big_little.c | 7 | ||||
-rw-r--r-- | drivers/cpufreq/arm_big_little.h | 5 | ||||
-rw-r--r-- | drivers/cpufreq/arm_big_little_dt.c | 1 |
3 files changed, 11 insertions, 2 deletions
diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c index a46c223c2506..e1a6ba66a7f5 100644 --- a/drivers/cpufreq/arm_big_little.c +++ b/drivers/cpufreq/arm_big_little.c | |||
@@ -289,6 +289,8 @@ static void _put_cluster_clk_and_freq_table(struct device *cpu_dev) | |||
289 | 289 | ||
290 | clk_put(clk[cluster]); | 290 | clk_put(clk[cluster]); |
291 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); | 291 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); |
292 | if (arm_bL_ops->free_opp_table) | ||
293 | arm_bL_ops->free_opp_table(cpu_dev); | ||
292 | dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster); | 294 | dev_dbg(cpu_dev, "%s: cluster: %d\n", __func__, cluster); |
293 | } | 295 | } |
294 | 296 | ||
@@ -337,7 +339,7 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) | |||
337 | if (ret) { | 339 | if (ret) { |
338 | dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n", | 340 | dev_err(cpu_dev, "%s: failed to init cpufreq table, cpu: %d, err: %d\n", |
339 | __func__, cpu_dev->id, ret); | 341 | __func__, cpu_dev->id, ret); |
340 | goto out; | 342 | goto free_opp_table; |
341 | } | 343 | } |
342 | 344 | ||
343 | name[12] = cluster + '0'; | 345 | name[12] = cluster + '0'; |
@@ -354,6 +356,9 @@ static int _get_cluster_clk_and_freq_table(struct device *cpu_dev) | |||
354 | ret = PTR_ERR(clk[cluster]); | 356 | ret = PTR_ERR(clk[cluster]); |
355 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); | 357 | dev_pm_opp_free_cpufreq_table(cpu_dev, &freq_table[cluster]); |
356 | 358 | ||
359 | free_opp_table: | ||
360 | if (arm_bL_ops->free_opp_table) | ||
361 | arm_bL_ops->free_opp_table(cpu_dev); | ||
357 | out: | 362 | out: |
358 | dev_err(cpu_dev, "%s: Failed to get data for cluster: %d\n", __func__, | 363 | dev_err(cpu_dev, "%s: Failed to get data for cluster: %d\n", __func__, |
359 | cluster); | 364 | cluster); |
diff --git a/drivers/cpufreq/arm_big_little.h b/drivers/cpufreq/arm_big_little.h index 70f18fc12d4a..a211f7db9d32 100644 --- a/drivers/cpufreq/arm_big_little.h +++ b/drivers/cpufreq/arm_big_little.h | |||
@@ -25,13 +25,16 @@ | |||
25 | 25 | ||
26 | struct cpufreq_arm_bL_ops { | 26 | struct cpufreq_arm_bL_ops { |
27 | char name[CPUFREQ_NAME_LEN]; | 27 | char name[CPUFREQ_NAME_LEN]; |
28 | int (*get_transition_latency)(struct device *cpu_dev); | ||
29 | 28 | ||
30 | /* | 29 | /* |
31 | * This must set opp table for cpu_dev in a similar way as done by | 30 | * This must set opp table for cpu_dev in a similar way as done by |
32 | * of_init_opp_table(). | 31 | * of_init_opp_table(). |
33 | */ | 32 | */ |
34 | int (*init_opp_table)(struct device *cpu_dev); | 33 | int (*init_opp_table)(struct device *cpu_dev); |
34 | |||
35 | /* Optional */ | ||
36 | int (*get_transition_latency)(struct device *cpu_dev); | ||
37 | void (*free_opp_table)(struct device *cpu_dev); | ||
35 | }; | 38 | }; |
36 | 39 | ||
37 | int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); | 40 | int bL_cpufreq_register(struct cpufreq_arm_bL_ops *ops); |
diff --git a/drivers/cpufreq/arm_big_little_dt.c b/drivers/cpufreq/arm_big_little_dt.c index 4550f6976768..ef0b3f1324d5 100644 --- a/drivers/cpufreq/arm_big_little_dt.c +++ b/drivers/cpufreq/arm_big_little_dt.c | |||
@@ -82,6 +82,7 @@ static struct cpufreq_arm_bL_ops dt_bL_ops = { | |||
82 | .name = "dt-bl", | 82 | .name = "dt-bl", |
83 | .get_transition_latency = dt_get_transition_latency, | 83 | .get_transition_latency = dt_get_transition_latency, |
84 | .init_opp_table = dt_init_opp_table, | 84 | .init_opp_table = dt_init_opp_table, |
85 | .free_opp_table = of_free_opp_table, | ||
85 | }; | 86 | }; |
86 | 87 | ||
87 | static int generic_bL_probe(struct platform_device *pdev) | 88 | static int generic_bL_probe(struct platform_device *pdev) |