Browse Source

thermal: imx: correct driver load sequence for cpu cooling

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>
Bai Ping 11 years ago
parent
commit
491b079db3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      drivers/thermal/imx_thermal.c

+ 4 - 0
drivers/thermal/imx_thermal.c

@@ -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;