cpufreq: qoriq: Don't show cooling device messages if THERMAL_OF undefined
authorJia Hongtao <hongtao.jia@nxp.com>
Mon, 18 Apr 2016 07:59:32 +0000 (15:59 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 25 Apr 2016 14:00:42 +0000 (16:00 +0200)
When THERMAL_OF is undefined the cooling device messages should not be
shown. -ENOSYS is returned from of_cpufreq_cooling_register() when
THERMAL_OF is undefined.

Signed-off-by: Jia Hongtao <hongtao.jia@nxp.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/qoriq-cpufreq.c

index b23e525a7af3fc21ad9fa85be59d3cb6a3ba27ba..8b7758936fcf0b9c9b2c4d6561af24e2e898beab 100644 (file)
@@ -333,8 +333,8 @@ static void qoriq_cpufreq_ready(struct cpufreq_policy *policy)
                cpud->cdev = of_cpufreq_cooling_register(np,
                                                         policy->related_cpus);
 
-               if (IS_ERR(cpud->cdev)) {
-                       pr_err("Failed to register cooling device cpu%d: %ld\n",
+               if (IS_ERR(cpud->cdev) && PTR_ERR(cpud->cdev) != -ENOSYS) {
+                       pr_err("cpu%d is not running as cooling device: %ld\n",
                                        policy->cpu, PTR_ERR(cpud->cdev));
 
                        cpud->cdev = NULL;