diff options
Diffstat (limited to 'kernel/power/main.c')
-rw-r--r-- | kernel/power/main.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index f71c9504a5c5..efc08360e627 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
@@ -276,8 +276,7 @@ EXPORT_SYMBOL(pm_suspend); | |||
276 | 276 | ||
277 | #endif /* CONFIG_SUSPEND */ | 277 | #endif /* CONFIG_SUSPEND */ |
278 | 278 | ||
279 | decl_subsys(power,NULL,NULL); | 279 | struct kobject *power_kobj; |
280 | |||
281 | 280 | ||
282 | /** | 281 | /** |
283 | * state - control system power state. | 282 | * state - control system power state. |
@@ -290,7 +289,8 @@ decl_subsys(power,NULL,NULL); | |||
290 | * proper enumerated value, and initiates a suspend transition. | 289 | * proper enumerated value, and initiates a suspend transition. |
291 | */ | 290 | */ |
292 | 291 | ||
293 | static ssize_t state_show(struct kset *kset, char *buf) | 292 | static ssize_t state_show(struct kobject *kobj, struct kobj_attribute *attr, |
293 | char *buf) | ||
294 | { | 294 | { |
295 | char *s = buf; | 295 | char *s = buf; |
296 | #ifdef CONFIG_SUSPEND | 296 | #ifdef CONFIG_SUSPEND |
@@ -311,7 +311,8 @@ static ssize_t state_show(struct kset *kset, char *buf) | |||
311 | return (s - buf); | 311 | return (s - buf); |
312 | } | 312 | } |
313 | 313 | ||
314 | static ssize_t state_store(struct kset *kset, const char *buf, size_t n) | 314 | static ssize_t state_store(struct kobject *kobj, struct kobj_attribute *attr, |
315 | const char *buf, size_t n) | ||
315 | { | 316 | { |
316 | #ifdef CONFIG_SUSPEND | 317 | #ifdef CONFIG_SUSPEND |
317 | suspend_state_t state = PM_SUSPEND_STANDBY; | 318 | suspend_state_t state = PM_SUSPEND_STANDBY; |
@@ -348,13 +349,15 @@ power_attr(state); | |||
348 | #ifdef CONFIG_PM_TRACE | 349 | #ifdef CONFIG_PM_TRACE |
349 | int pm_trace_enabled; | 350 | int pm_trace_enabled; |
350 | 351 | ||
351 | static ssize_t pm_trace_show(struct kset *kset, char *buf) | 352 | static ssize_t pm_trace_show(struct kobject *kobj, struct kobj_attribute *attr, |
353 | char *buf) | ||
352 | { | 354 | { |
353 | return sprintf(buf, "%d\n", pm_trace_enabled); | 355 | return sprintf(buf, "%d\n", pm_trace_enabled); |
354 | } | 356 | } |
355 | 357 | ||
356 | static ssize_t | 358 | static ssize_t |
357 | pm_trace_store(struct kset *kset, const char *buf, size_t n) | 359 | pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr, |
360 | const char *buf, size_t n) | ||
358 | { | 361 | { |
359 | int val; | 362 | int val; |
360 | 363 | ||
@@ -386,10 +389,10 @@ static struct attribute_group attr_group = { | |||
386 | 389 | ||
387 | static int __init pm_init(void) | 390 | static int __init pm_init(void) |
388 | { | 391 | { |
389 | int error = subsystem_register(&power_subsys); | 392 | power_kobj = kobject_create_and_add("power", NULL); |
390 | if (!error) | 393 | if (!power_kobj) |
391 | error = sysfs_create_group(&power_subsys.kobj,&attr_group); | 394 | return -ENOMEM; |
392 | return error; | 395 | return sysfs_create_group(power_kobj, &attr_group); |
393 | } | 396 | } |
394 | 397 | ||
395 | core_initcall(pm_init); | 398 | core_initcall(pm_init); |