diff mbox series

[3/6] cpufreq/drivers/arm_big_little: Remove cooling device usage

Message ID 20190621132302.30414-3-daniel.lezcano@linaro.org
State New
Headers show
Series None | expand

Commit Message

Daniel Lezcano June 21, 2019, 1:22 p.m. UTC
The cpufreq_cooling_unregister() function uses now the policy to
unregister itself. The only purpose of the cooling device pointer is
to unregister the cpu cooling device.

As there is no more need of this pointer, remove it.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

---
 drivers/cpufreq/arm_big_little.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.17.1

Comments

Viresh Kumar June 24, 2019, 6:04 a.m. UTC | #1
On 21-06-19, 15:22, Daniel Lezcano wrote:
> The cpufreq_cooling_unregister() function uses now the policy to

> unregister itself. The only purpose of the cooling device pointer is

> to unregister the cpu cooling device.

> 

> As there is no more need of this pointer, remove it.

> 

> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

> ---

>  drivers/cpufreq/arm_big_little.c | 7 ++-----

>  1 file changed, 2 insertions(+), 5 deletions(-)

> 

> diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c

> index 6b243202caa9..718c63231e66 100644

> --- a/drivers/cpufreq/arm_big_little.c

> +++ b/drivers/cpufreq/arm_big_little.c

> @@ -56,7 +56,6 @@ static bool bL_switching_enabled;

>  #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)

>  #define VIRT_FREQ(cluster, freq)    ((cluster == A7_CLUSTER) ? freq >> 1 : freq)

>  

> -static struct thermal_cooling_device *cdev[MAX_CLUSTERS];

>  static const struct cpufreq_arm_bL_ops *arm_bL_ops;

>  static struct clk *clk[MAX_CLUSTERS];

>  static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1];

> @@ -501,10 +500,8 @@ static int bL_cpufreq_exit(struct cpufreq_policy *policy)

>  	struct device *cpu_dev;

>  	int cur_cluster = cpu_to_cluster(policy->cpu);

>  

> -	if (cur_cluster < MAX_CLUSTERS) {

> +	if (cur_cluster < MAX_CLUSTERS)

>  		cpufreq_cooling_unregister(policy);

> -		cdev[cur_cluster] = NULL;

> -	}

>  

>  	cpu_dev = get_cpu_device(policy->cpu);

>  	if (!cpu_dev) {

> @@ -527,7 +524,7 @@ static void bL_cpufreq_ready(struct cpufreq_policy *policy)

>  	if (cur_cluster >= MAX_CLUSTERS)

>  		return;

>  

> -	cdev[cur_cluster] = of_cpufreq_cooling_register(policy);

> +	of_cpufreq_cooling_register(policy);

>  }

>  

>  static struct cpufreq_driver bL_cpufreq_driver = {


I will merge it with the previous commit if I were you.

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>


-- 
viresh
diff mbox series

Patch

diff --git a/drivers/cpufreq/arm_big_little.c b/drivers/cpufreq/arm_big_little.c
index 6b243202caa9..718c63231e66 100644
--- a/drivers/cpufreq/arm_big_little.c
+++ b/drivers/cpufreq/arm_big_little.c
@@ -56,7 +56,6 @@  static bool bL_switching_enabled;
 #define ACTUAL_FREQ(cluster, freq)  ((cluster == A7_CLUSTER) ? freq << 1 : freq)
 #define VIRT_FREQ(cluster, freq)    ((cluster == A7_CLUSTER) ? freq >> 1 : freq)
 
-static struct thermal_cooling_device *cdev[MAX_CLUSTERS];
 static const struct cpufreq_arm_bL_ops *arm_bL_ops;
 static struct clk *clk[MAX_CLUSTERS];
 static struct cpufreq_frequency_table *freq_table[MAX_CLUSTERS + 1];
@@ -501,10 +500,8 @@  static int bL_cpufreq_exit(struct cpufreq_policy *policy)
 	struct device *cpu_dev;
 	int cur_cluster = cpu_to_cluster(policy->cpu);
 
-	if (cur_cluster < MAX_CLUSTERS) {
+	if (cur_cluster < MAX_CLUSTERS)
 		cpufreq_cooling_unregister(policy);
-		cdev[cur_cluster] = NULL;
-	}
 
 	cpu_dev = get_cpu_device(policy->cpu);
 	if (!cpu_dev) {
@@ -527,7 +524,7 @@  static void bL_cpufreq_ready(struct cpufreq_policy *policy)
 	if (cur_cluster >= MAX_CLUSTERS)
 		return;
 
-	cdev[cur_cluster] = of_cpufreq_cooling_register(policy);
+	of_cpufreq_cooling_register(policy);
 }
 
 static struct cpufreq_driver bL_cpufreq_driver = {