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

Showing the changes to include/linux/cpu_cooling.h (1 of 1 file). Show all

Unified · Split

include/linux/cpu_cooling.h+3−3
@@ -50,7 +50,7 @@ static inline struct thermal_cooling_device * · 49 unmodified lines
50of_cpufreq_cooling_register(struct device_node *np,50of_cpufreq_cooling_register(struct device_node *np,
51 const struct cpumask *clip_cpus)51 const struct cpumask *clip_cpus)
52{52{
53 return NULL;53 return ERR_PTR(-ENOSYS);
54}54}
55#endif55#endif
56 56
@@ -65,13 +65,13 @@ unsigned long cpufreq_cooling_get_level(unsigned int cpu, unsigned int freq); · 8 unmodified lines
65static inline struct thermal_cooling_device *65static inline struct thermal_cooling_device *
66cpufreq_cooling_register(const struct cpumask *clip_cpus)66cpufreq_cooling_register(const struct cpumask *clip_cpus)
67{67{
68 return NULL;68 return ERR_PTR(-ENOSYS);
69}69}
70static inline struct thermal_cooling_device *70static inline struct thermal_cooling_device *
71of_cpufreq_cooling_register(struct device_node *np,71of_cpufreq_cooling_register(struct device_node *np,
72 const struct cpumask *clip_cpus)72 const struct cpumask *clip_cpus)
73{73{
74 return NULL;74 return ERR_PTR(-ENOSYS);
75}75}
76static inline76static inline
77void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)77void 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