History

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.

Javi Merino committed 11 years ago

Commit 503ccc31 parent 2d2e95e1 file · +3 −3Browse files

Unified · Split

include/linux/cpu_cooling.h+3−3
@@ -50,7 +50,7 @@ static inline struct thermal_cooling_device * · 49 unmodified lines
5050 of_cpufreq_cooling_register(struct device_node *np,
5151 const struct cpumask *clip_cpus)
5252 {
53− return NULL;
53+ return ERR_PTR(-ENOSYS);
5454 }
5555 #endif
5656
@@ -65,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); · 8 unmodified lines
6565 static inline struct thermal_cooling_device *
6666 cpufreq_cooling_register(const struct cpumask *clip_cpus)
6767 {
68− return NULL;
68+ return ERR_PTR(-ENOSYS);
6969 }
7070 static inline struct thermal_cooling_device *
7171 of_cpufreq_cooling_register(struct device_node *np,
7272 const struct cpumask *clip_cpus)
7373 {
74− return NULL;
74+ return ERR_PTR(-ENOSYS);
7575 }
7676 static inline
7777 void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t