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.
Showing the changes to include/linux/cpu_cooling.h (1 of 1 file). Show all
Unified · Split
| @@ -50,7 +50,7 @@ static inline struct thermal_cooling_device * · 49 unmodified lines | ||
| 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,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); · 8 unmodified lines | ||
| 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) |