summaryrefslogtreecommitdiffstats
path: root/include/linux/cpu_cooling.h
diff options
context:
space:
mode:
authorJavi Merino2014-12-17 12:11:24 +0100
committerEduardo Valentin2014-12-17 14:00:04 +0100
commit503ccc3fec4a56cdcfedc507cd1ea0d85e1fbfa2 (patch)
tree1d2e39ee5a9eb3bf24f02fa9eb8754826ee57859 /include/linux/cpu_cooling.h
parentthermal: cpu_cooling: small memory leak on error (diff)
downloadkernel-qcow2-linux-503ccc3fec4a56cdcfedc507cd1ea0d85e1fbfa2.tar.gz
kernel-qcow2-linux-503ccc3fec4a56cdcfedc507cd1ea0d85e1fbfa2.tar.xz
kernel-qcow2-linux-503ccc3fec4a56cdcfedc507cd1ea0d85e1fbfa2.zip
thermal: cpu_cooling: return ERR_PTR() for !CPU_THERMAL or !THERMAL_OF
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>
Diffstat (limited to 'include/linux/cpu_cooling.h')
-rw-r--r--include/linux/cpu_cooling.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/cpu_cooling.h b/include/linux/cpu_cooling.h
index c303d383def1..bd955270d5aa 100644
--- a/include/linux/cpu_cooling.h
+++ b/include/linux/cpu_cooling.h
@@ -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)