diff mbox series

[4/6] cpufreq: Remove cooling device usage

Message ID 20190621132302.30414-4-daniel.lezcano@linaro.org
State New
Headers show
Series [1/6] cpufreq: Use existing stub functions instead of IS_ENABLED macro | expand

Commit Message

Daniel Lezcano June 21, 2019, 1:23 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/cpufreq.c | 6 ++----
 include/linux/cpufreq.h   | 3 ---
 2 files changed, 2 insertions(+), 7 deletions(-)

-- 
2.17.1

Comments

Viresh Kumar June 24, 2019, 6:05 a.m. UTC | #1
On 21-06-19, 15:23, 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/cpufreq.c | 6 ++----

>  include/linux/cpufreq.h   | 3 ---

>  2 files changed, 2 insertions(+), 7 deletions(-)

> 

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

> index dfbc9bea606c..1d8f85faeaca 100644

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

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

> @@ -1379,7 +1379,7 @@ static int cpufreq_online(unsigned int cpu)

>  		cpufreq_driver->ready(policy);

>  

>  	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV)

> -		policy->cdev = of_cpufreq_cooling_register(policy);

> +		of_cpufreq_cooling_register(policy);

>  

>  	pr_debug("initialization complete\n");

>  

> @@ -1468,10 +1468,8 @@ static int cpufreq_offline(unsigned int cpu)

>  		goto unlock;

>  	}

>  

> -	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) {

> +	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV)

>  		cpufreq_cooling_unregister(policy);

> -		policy->cdev = NULL;

> -	}

>  

>  	if (cpufreq_driver->stop_cpu)

>  		cpufreq_driver->stop_cpu(policy);

> diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h

> index d01a74fbc4db..9a42711f338b 100644

> --- a/include/linux/cpufreq.h

> +++ b/include/linux/cpufreq.h

> @@ -144,9 +144,6 @@ struct cpufreq_policy {

>  

>  	/* For cpufreq driver's internal use */

>  	void			*driver_data;

> -

> -	/* Pointer to the cooling device if used for thermal mitigation */

> -	struct thermal_cooling_device *cdev;

>  };

>  

>  struct cpufreq_freqs {


This too. In my view this should be merged with 2/6.

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


-- 
viresh
diff mbox series

Patch

diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index dfbc9bea606c..1d8f85faeaca 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -1379,7 +1379,7 @@  static int cpufreq_online(unsigned int cpu)
 		cpufreq_driver->ready(policy);
 
 	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV)
-		policy->cdev = of_cpufreq_cooling_register(policy);
+		of_cpufreq_cooling_register(policy);
 
 	pr_debug("initialization complete\n");
 
@@ -1468,10 +1468,8 @@  static int cpufreq_offline(unsigned int cpu)
 		goto unlock;
 	}
 
-	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV) {
+	if (cpufreq_driver->flags & CPUFREQ_IS_COOLING_DEV)
 		cpufreq_cooling_unregister(policy);
-		policy->cdev = NULL;
-	}
 
 	if (cpufreq_driver->stop_cpu)
 		cpufreq_driver->stop_cpu(policy);
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index d01a74fbc4db..9a42711f338b 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -144,9 +144,6 @@  struct cpufreq_policy {
 
 	/* For cpufreq driver's internal use */
 	void			*driver_data;
-
-	/* Pointer to the cooling device if used for thermal mitigation */
-	struct thermal_cooling_device *cdev;
 };
 
 struct cpufreq_freqs {