Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Javi Merino and committed by
Eduardo Valentin
503ccc3f 2d2e95ea

+3 -3
+3 -3
include/linux/cpu_cooling.h
··· 50 50 of_cpufreq_cooling_register(struct device_node *np, 51 51 const struct cpumask *clip_cpus) 52 52 { 53 - return NULL; 53 + return ERR_PTR(-ENOSYS); 54 54 } 55 55 #endif 56 56 ··· 65 65 static inline struct thermal_cooling_device * 66 66 cpufreq_cooling_register(const struct cpumask *clip_cpus) 67 67 { 68 - return NULL; 68 + return ERR_PTR(-ENOSYS); 69 69 } 70 70 static inline struct thermal_cooling_device * 71 71 of_cpufreq_cooling_register(struct device_node *np, 72 72 const struct cpumask *clip_cpus) 73 73 { 74 - return NULL; 74 + return ERR_PTR(-ENOSYS); 75 75 } 76 76 static inline 77 77 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)