diff mbox

[v2] thermal: imx: correct driver load sequence for cpu cooling

Message ID 1413263527-31102-1-git-send-email-B51503@freescale.com (mailing list archive)
State Accepted
Delegated to: Eduardo Valentin
Headers show

Commit Message

Bai Ping Oct. 14, 2014, 5:12 a.m. UTC
From: Bai Ping <b51503@freescale.com>

thermal driver should be regisetered after cpufreq driver has
been registered and probed. Doing so is to make sure that thermal
driver can get the max cpu cooling states correctly when calling
get_property.

Signed-off-by: Bai Ping <b51503@freescale.com>
---
Changes for v2
-Address the comments from Eduardo Valentin

 drivers/thermal/imx_thermal.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Eduardo Valentin Nov. 7, 2014, 6:47 p.m. UTC | #1
Hello Bai,

On Tue, Oct 14, 2014 at 01:12:07PM +0800, Bai Ping wrote:
> From: Bai Ping <b51503@freescale.com>
> 
> thermal driver should be regisetered after cpufreq driver has
> been registered and probed. Doing so is to make sure that thermal
> driver can get the max cpu cooling states correctly when calling
> get_property.
> 
> Signed-off-by: Bai Ping <b51503@freescale.com>
> ---
> Changes for v2
> -Address the comments from Eduardo Valentin
> 

Thanks for addressing the comments. Applied in my -fixes queue.

>  drivers/thermal/imx_thermal.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
> index 2c516f2..8697caf 100644
> --- a/drivers/thermal/imx_thermal.c
> +++ b/drivers/thermal/imx_thermal.c
> @@ -406,6 +406,10 @@ static int imx_thermal_probe(struct platform_device *pdev)
>  	int measure_freq;
>  	int ret;
>  
> +	if (!cpufreq_get_current_driver()) {
> +		dev_dbg(&pdev->dev, "no cpufreq driver!");
> +		return -EPROBE_DEFER;
> +	}
>  	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
>  	if (!data)
>  		return -ENOMEM;
> -- 
> 1.9.1
>
diff mbox

Patch

diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index 2c516f2..8697caf 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -406,6 +406,10 @@  static int imx_thermal_probe(struct platform_device *pdev)
 	int measure_freq;
 	int ret;
 
+	if (!cpufreq_get_current_driver()) {
+		dev_dbg(&pdev->dev, "no cpufreq driver!");
+		return -EPROBE_DEFER;
+	}
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
 	if (!data)
 		return -ENOMEM;