diff mbox series

thermal: imx: Calling imx_thermal_unregister_legacy_cooling() in .remove

Message ID 1584088094-24857-1-git-send-email-Anson.Huang@nxp.com (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series thermal: imx: Calling imx_thermal_unregister_legacy_cooling() in .remove | expand

Commit Message

Anson Huang March 13, 2020, 8:28 a.m. UTC
imx_thermal_unregister_legacy_cooling() should be used for handling
legacy cpufreq cooling cleanups in .remove callback instead of
calling cpufreq_cooling_unregister() and cpufreq_cpu_put() directly,
especially for !CONFIG_CPU_FREQ scenario, no operation needed for
handling legacy cpufreq cooling cleanups at all.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 drivers/thermal/imx_thermal.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Daniel Lezcano March 13, 2020, 12:31 p.m. UTC | #1
On 13/03/2020 09:28, Anson Huang wrote:
> imx_thermal_unregister_legacy_cooling() should be used for handling
> legacy cpufreq cooling cleanups in .remove callback instead of
> calling cpufreq_cooling_unregister() and cpufreq_cpu_put() directly,
> especially for !CONFIG_CPU_FREQ scenario, no operation needed for
> handling legacy cpufreq cooling cleanups at all.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied, thanks

> ---
>  drivers/thermal/imx_thermal.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index d2fa301..e761c9b 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -865,8 +865,7 @@ static int imx_thermal_remove(struct platform_device *pdev)
>  		clk_disable_unprepare(data->thermal_clk);
>  
>  	thermal_zone_device_unregister(data->tz);
> -	cpufreq_cooling_unregister(data->cdev);
> -	cpufreq_cpu_put(data->policy);
> +	imx_thermal_unregister_legacy_cooling(data);
>  
>  	return 0;
>  }
>
diff mbox series

Patch

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index d2fa301..e761c9b 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -865,8 +865,7 @@  static int imx_thermal_remove(struct platform_device *pdev)
 		clk_disable_unprepare(data->thermal_clk);
 
 	thermal_zone_device_unregister(data->tz);
-	cpufreq_cooling_unregister(data->cdev);
-	cpufreq_cpu_put(data->policy);
+	imx_thermal_unregister_legacy_cooling(data);
 
 	return 0;
 }