From: Bai Ping Date: Tue, 14 Oct 2014 05:12:07 +0000 (+0800) Subject: thermal: imx: correct driver load sequence for cpu cooling X-Git-Tag: v4.9.8~5372^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=491b079db3f7fa631f6a012e7e896a1eafe4dd99;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Eduardo Valentin --- diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c index 461bf3d..0e35999 100644 --- a/drivers/thermal/imx_thermal.c +++ b/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;