cpuidle_register_driver() sets cpuidle_curr_driver cpuidle_unregister_driver() clears cpuidle_curr_driver We should't expose cpuidle_curr_driver to potential modification except via these interfaces. So make it static and create cpuidle_get_driver() to observe it.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -125,6 +125,7 @@ struct cpuidle_driver { · 124 unmodified lines | ||
| 125 | 125 | #ifdef CONFIG_CPU_IDLE |
| 126 | 126 | |
| 127 | 127 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
| 128 | +struct cpuidle_driver *cpuidle_get_driver(void); | |
| 128 | 129 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
| 129 | 130 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
| 130 | 131 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); |
| @@ -138,6 +139,7 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev); · 7 unmodified lines | ||
| 138 | 139 | |
| 139 | 140 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) |
| 140 | 141 | {return -ENODEV; } |
| 142 | +static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } | |
| 141 | 143 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } |
| 142 | 144 | static inline int cpuidle_register_device(struct cpuidle_device *dev) |
| 143 | 145 | {return -ENODEV; } |