Commit 503ccc3f authored by Javi Merino's avatar Javi Merino Committed by Eduardo Valentin

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: default avatarJavi Merino <javi.merino@arm.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 2d2e95ea
...@@ -50,7 +50,7 @@ static inline struct thermal_cooling_device * ...@@ -50,7 +50,7 @@ static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np, of_cpufreq_cooling_register(struct device_node *np,
const struct cpumask *clip_cpus) const struct cpumask *clip_cpus)
{ {
return NULL; return ERR_PTR(-ENOSYS);
} }
#endif #endif
...@@ -65,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); ...@@ -65,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq);
static inline struct thermal_cooling_device * static inline struct thermal_cooling_device *
cpufreq_cooling_register(const struct cpumask *clip_cpus) cpufreq_cooling_register(const struct cpumask *clip_cpus)
{ {
return NULL; return ERR_PTR(-ENOSYS);
} }
static inline struct thermal_cooling_device * static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np, of_cpufreq_cooling_register(struct device_node *np,
const struct cpumask *clip_cpus) const struct cpumask *clip_cpus)
{ {
return NULL; return ERR_PTR(-ENOSYS);
} }
static inline static inline
void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment