diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2014-05-09 03:43:08 -0400 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2014-05-24 09:33:38 -0400 |
commit | 8cd84092d35e52372da2c3c3c2afb1a719917af2 (patch) | |
tree | ccb37cbe9e233257050288dbae74c6b3d914b55f /include/linux/devfreq.h | |
parent | 585fc83ece43be63d5775e536f855db33dd752cf (diff) |
PM / devfreq: Add resource-managed function for devfreq device
This patch add resource-managed function for devfreq device as following
functions. The devm_devfreq_add_device() manages automatically the memory
of devfreq device using device resource management.
- devm_devfreq_add_device()
- devm_devfreq_remove_device()
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'include/linux/devfreq.h')
-rw-r--r-- | include/linux/devfreq.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index d48dc00232a4..023d668a2cb5 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -181,6 +181,12 @@ extern struct devfreq *devfreq_add_device(struct device *dev, | |||
181 | const char *governor_name, | 181 | const char *governor_name, |
182 | void *data); | 182 | void *data); |
183 | extern int devfreq_remove_device(struct devfreq *devfreq); | 183 | extern int devfreq_remove_device(struct devfreq *devfreq); |
184 | extern struct devfreq *devm_devfreq_add_device(struct device *dev, | ||
185 | struct devfreq_dev_profile *profile, | ||
186 | const char *governor_name, | ||
187 | void *data); | ||
188 | extern void devm_devfreq_remove_device(struct device *dev, | ||
189 | struct devfreq *devfreq); | ||
184 | 190 | ||
185 | /* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */ | 191 | /* Supposed to be called by PM_SLEEP/PM_RUNTIME callbacks */ |
186 | extern int devfreq_suspend_device(struct devfreq *devfreq); | 192 | extern int devfreq_suspend_device(struct devfreq *devfreq); |
@@ -220,7 +226,7 @@ static inline struct devfreq *devfreq_add_device(struct device *dev, | |||
220 | const char *governor_name, | 226 | const char *governor_name, |
221 | void *data) | 227 | void *data) |
222 | { | 228 | { |
223 | return NULL; | 229 | return ERR_PTR(-ENOSYS); |
224 | } | 230 | } |
225 | 231 | ||
226 | static inline int devfreq_remove_device(struct devfreq *devfreq) | 232 | static inline int devfreq_remove_device(struct devfreq *devfreq) |
@@ -228,6 +234,19 @@ static inline int devfreq_remove_device(struct devfreq *devfreq) | |||
228 | return 0; | 234 | return 0; |
229 | } | 235 | } |
230 | 236 | ||
237 | static inline struct devfreq *devm_devfreq_add_device(struct device *dev, | ||
238 | struct devfreq_dev_profile *profile, | ||
239 | const char *governor_name, | ||
240 | void *data) | ||
241 | { | ||
242 | return ERR_PTR(-ENOSYS); | ||
243 | } | ||
244 | |||
245 | static inline void devm_devfreq_remove_device(struct device *dev, | ||
246 | struct devfreq *devfreq) | ||
247 | { | ||
248 | } | ||
249 | |||
231 | static inline int devfreq_suspend_device(struct devfreq *devfreq) | 250 | static inline int devfreq_suspend_device(struct devfreq *devfreq) |
232 | { | 251 | { |
233 | return 0; | 252 | return 0; |