diff options
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 72419a3b1beb..f6dda685e7e2 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -184,17 +184,21 @@ static void suspend_finish(suspend_state_t state) | |||
184 | static const char * const pm_states[PM_SUSPEND_MAX] = { | 184 | static const char * const pm_states[PM_SUSPEND_MAX] = { |
185 | [PM_SUSPEND_STANDBY] = "standby", | 185 | [PM_SUSPEND_STANDBY] = "standby", |
186 | [PM_SUSPEND_MEM] = "mem", | 186 | [PM_SUSPEND_MEM] = "mem", |
187 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
188 | [PM_SUSPEND_DISK] = "disk", | 187 | [PM_SUSPEND_DISK] = "disk", |
189 | #endif | ||
190 | }; | 188 | }; |
191 | 189 | ||
192 | static inline int valid_state(suspend_state_t state) | 190 | static inline int valid_state(suspend_state_t state) |
193 | { | 191 | { |
194 | /* Suspend-to-disk does not really need low-level support. | 192 | /* Suspend-to-disk does not really need low-level support. |
195 | * It can work with reboot if needed. */ | 193 | * It can work with shutdown/reboot if needed. If it isn't |
194 | * configured, then it cannot be supported. | ||
195 | */ | ||
196 | if (state == PM_SUSPEND_DISK) | 196 | if (state == PM_SUSPEND_DISK) |
197 | #ifdef CONFIG_SOFTWARE_SUSPEND | ||
197 | return 1; | 198 | return 1; |
199 | #else | ||
200 | return 0; | ||
201 | #endif | ||
198 | 202 | ||
199 | /* all other states need lowlevel support and need to be | 203 | /* all other states need lowlevel support and need to be |
200 | * valid to the lowlevel implementation, no valid callback | 204 | * valid to the lowlevel implementation, no valid callback |
@@ -244,15 +248,6 @@ static int enter_state(suspend_state_t state) | |||
244 | return error; | 248 | return error; |
245 | } | 249 | } |
246 | 250 | ||
247 | /* | ||
248 | * This is main interface to the outside world. It needs to be | ||
249 | * called from process context. | ||
250 | */ | ||
251 | int software_suspend(void) | ||
252 | { | ||
253 | return enter_state(PM_SUSPEND_DISK); | ||
254 | } | ||
255 | |||
256 | 251 | ||
257 | /** | 252 | /** |
258 | * pm_suspend - Externally visible function for suspending system. | 253 | * pm_suspend - Externally visible function for suspending system. |
@@ -285,7 +280,7 @@ decl_subsys(power,NULL,NULL); | |||
285 | * proper enumerated value, and initiates a suspend transition. | 280 | * proper enumerated value, and initiates a suspend transition. |
286 | */ | 281 | */ |
287 | 282 | ||
288 | static ssize_t state_show(struct subsystem * subsys, char * buf) | 283 | static ssize_t state_show(struct kset *kset, char *buf) |
289 | { | 284 | { |
290 | int i; | 285 | int i; |
291 | char * s = buf; | 286 | char * s = buf; |
@@ -298,7 +293,7 @@ static ssize_t state_show(struct subsystem * subsys, char * buf) | |||
298 | return (s - buf); | 293 | return (s - buf); |
299 | } | 294 | } |
300 | 295 | ||
301 | static ssize_t state_store(struct subsystem * subsys, const char * buf, size_t n) | 296 | static ssize_t state_store(struct kset *kset, const char *buf, size_t n) |
302 | { | 297 | { |
303 | suspend_state_t state = PM_SUSPEND_STANDBY; | 298 | suspend_state_t state = PM_SUSPEND_STANDBY; |
304 | const char * const *s; | 299 | const char * const *s; |
@@ -325,13 +320,13 @@ power_attr(state); | |||
325 | #ifdef CONFIG_PM_TRACE | 320 | #ifdef CONFIG_PM_TRACE |
326 | int pm_trace_enabled; | 321 | int pm_trace_enabled; |
327 | 322 | ||
328 | static ssize_t pm_trace_show(struct subsystem * subsys, char * buf) | 323 | static ssize_t pm_trace_show(struct kset *kset, char *buf) |
329 | { | 324 | { |
330 | return sprintf(buf, "%d\n", pm_trace_enabled); | 325 | return sprintf(buf, "%d\n", pm_trace_enabled); |
331 | } | 326 | } |
332 | 327 | ||
333 | static ssize_t | 328 | static ssize_t |
334 | pm_trace_store(struct subsystem * subsys, const char * buf, size_t n) | 329 | pm_trace_store(struct kset *kset, const char *buf, size_t n) |
335 | { | 330 | { |
336 | int val; | 331 | int val; |
337 | 332 | ||
@@ -365,7 +360,7 @@ static int __init pm_init(void) | |||
365 | { | 360 | { |
366 | int error = subsystem_register(&power_subsys); | 361 | int error = subsystem_register(&power_subsys); |
367 | if (!error) | 362 | if (!error) |
368 | error = sysfs_create_group(&power_subsys.kset.kobj,&attr_group); | 363 | error = sysfs_create_group(&power_subsys.kobj,&attr_group); |
369 | return error; | 364 | return error; |
370 | } | 365 | } |
371 | 366 | ||