thermal: imx: correct driver load sequence for cpu cooling
authorBai Ping <b51503@freescale.com>
Tue, 14 Oct 2014 05:12:07 +0000 (13:12 +0800)
committerEduardo Valentin <edubezval@gmail.com>
Fri, 7 Nov 2014 18:44:41 +0000 (14:44 -0400)
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>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
drivers/thermal/imx_thermal.c

index 461bf3d033a061833409c1fcc5d6538066d5016b..0e35999ad8b2a3874ca3086872337e44eb730ea7 100644 (file)
@@ -459,6 +459,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;