thermal: cpu_cooling: return ERR_PTR() for !CPU_THERMAL or !THERMAL_OF
authorJavi Merino <javi.merino@arm.com>
Wed, 17 Dec 2014 11:11:24 +0000 (11:11 +0000)
committerEduardo Valentin <edubezval@gmail.com>
Wed, 17 Dec 2014 13:00:04 +0000 (09:00 -0400)
The documentation of of_cpufreq_cooling_register() and
cpufreq_cooling_register() say that they return ERR_PTR() on error.
Accordingly, callers only check for IS_ERR().  Therefore, make them
return ERR_PTR(-ENOSYS) as is customary in the kernel when config
options are missing.

Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
include/linux/cpu_cooling.h

index c303d383def1146589a30c980d2c8dadd1bd89cc..bd955270d5aae60f77cc8f936a5820d9690ac6ac 100644 (file)
@@ -50,7 +50,7 @@ static inline struct thermal_cooling_device *
 of_cpufreq_cooling_register(struct device_node *np,
                            const struct cpumask *clip_cpus)
 {
-       return NULL;
+       return ERR_PTR(-ENOSYS);
 }
 #endif
 
@@ -65,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq);
 static inline struct thermal_cooling_device *
 cpufreq_cooling_register(const struct cpumask *clip_cpus)
 {
-       return NULL;
+       return ERR_PTR(-ENOSYS);
 }
 static inline struct thermal_cooling_device *
 of_cpufreq_cooling_register(struct device_node *np,
                            const struct cpumask *clip_cpus)
 {
-       return NULL;
+       return ERR_PTR(-ENOSYS);
 }
 static inline
 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
This page took 0.027073 seconds and 5 git commands to generate.