diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-06-16 09:20:11 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-07-03 13:06:25 -0400 |
commit | 6e797a078824b30afbfae6cc4b1c2b21c51761ef (patch) | |
tree | 7f58824b2c1e62b954683900024a5b97a4d30b4d /include/linux/cpuidle.h | |
parent | dc7fd275ae60ef8edf952aff2a62462f5d892fd4 (diff) |
PM / cpuidle: Add driver reference counter
Add a reference counter for the cpuidle driver, so that it can't
be unregistered when it is in use.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r-- | include/linux/cpuidle.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 8570012a535a..27cfced7b57b 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -136,7 +136,9 @@ struct cpuidle_driver { | |||
136 | extern void disable_cpuidle(void); | 136 | extern void disable_cpuidle(void); |
137 | extern int cpuidle_idle_call(void); | 137 | extern int cpuidle_idle_call(void); |
138 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | 138 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
139 | struct cpuidle_driver *cpuidle_get_driver(void); | 139 | extern struct cpuidle_driver *cpuidle_get_driver(void); |
140 | extern struct cpuidle_driver *cpuidle_driver_ref(void); | ||
141 | extern void cpuidle_driver_unref(void); | ||
140 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); | 142 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
141 | extern int cpuidle_register_device(struct cpuidle_device *dev); | 143 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
142 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); | 144 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); |
@@ -157,6 +159,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; } | |||
157 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) | 159 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) |
158 | {return -ENODEV; } | 160 | {return -ENODEV; } |
159 | static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } | 161 | static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } |
162 | static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; } | ||
163 | static inline void cpuidle_driver_unref(void) {} | ||
160 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } | 164 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } |
161 | static inline int cpuidle_register_device(struct cpuidle_device *dev) | 165 | static inline int cpuidle_register_device(struct cpuidle_device *dev) |
162 | {return -ENODEV; } | 166 | {return -ENODEV; } |