From 0f1be51c358f740fe5183bd0bcd60076fdfb53d0 Mon Sep 17 00:00:00 2001 From: Eduardo Valentin Date: Thu, 4 Dec 2014 09:41:43 +0530 Subject: thermal: cpu_cooling: check for the readiness of cpufreq layer In this patch, the cpu_cooling code checks for the usability of cpufreq layer before proceeding with the CPU cooling device registration. The main reason is: CPU cooling device is not usable if cpufreq cannot switch frequencies. Similar checks are spread in thermal drivers. Thus, the advantage now is to have the check in a single place: cpu cooling device registration. For this reason, this patch also updates the existing drivers that depend on CPU cooling to simply propagate the error code of the cpu cooling registration call. Therefore, in case cpufreq is not ready, the thermal drivers will still return -EPROBE_DEFER, in an attempt to try again when cpufreq layer gets ready. Cc: devicetree@vger.kernel.org Cc: Grant Likely Cc: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-pm@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org Cc: Naveen Krishna Chatradhi Cc: Rob Herring Cc: Zhang Rui Acked-by: Viresh Kumar Signed-off-by: Viresh Kumar Signed-off-by: Eduardo Valentin --- drivers/thermal/db8500_cpufreq_cooling.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/thermal/db8500_cpufreq_cooling.c') diff --git a/drivers/thermal/db8500_cpufreq_cooling.c b/drivers/thermal/db8500_cpufreq_cooling.c index 786d19263ab0..1ac7ec651c3f 100644 --- a/drivers/thermal/db8500_cpufreq_cooling.c +++ b/drivers/thermal/db8500_cpufreq_cooling.c @@ -18,7 +18,6 @@ */ #include -#include #include #include #include @@ -30,10 +29,6 @@ static int db8500_cpufreq_cooling_probe(struct platform_device *pdev) struct thermal_cooling_device *cdev; struct cpumask mask_val; - /* make sure cpufreq driver has been initialized */ - if (!cpufreq_frequency_get_table(0)) - return -EPROBE_DEFER; - cpumask_set_cpu(0, &mask_val); cdev = cpufreq_cooling_register(&mask_val); -- cgit v1.2.3-55-g7522