aboutsummaryrefslogtreecommitdiff
path: root/kernel/power
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-01 10:39:50 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 20:40:16 -0800
commit039a5dcd2fc45188a2d522df630db4f7ef903a0f (patch)
treedbadc8ef13f00f90acf3c9caad8a3834a34f6ce9 /kernel/power
parent7405c1e15edfe43b137bfbc5882f1af34d6d414d (diff)
kset: convert /sys/power to use kset_create
Dynamically create the kset instead of declaring it statically. We also rename power_subsys to power_kset to catch all users of the variable and we properly export it so that people don't have to guess that it really is present in the system. The pseries code is wierd, why is it createing /sys/power if CONFIG_PM is disabled? Oh well, stupid big boxes ignoring config options... Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/disk.c2
-rw-r--r--kernel/power/main.c11
-rw-r--r--kernel/power/power.h2
3 files changed, 6 insertions, 9 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c
index 05b64790fe8..c3f0e61365d 100644
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -708,7 +708,7 @@ static struct attribute_group attr_group = {
static int __init pm_disk_init(void)
{
- return sysfs_create_group(&power_subsys.kobj, &attr_group);
+ return sysfs_create_group(&power_kset->kobj, &attr_group);
}
core_initcall(pm_disk_init);
diff --git a/kernel/power/main.c b/kernel/power/main.c
index 1ef31c91ce0..dce2d76d66d 100644
--- a/kernel/power/main.c
+++ b/kernel/power/main.c
@@ -276,8 +276,7 @@ EXPORT_SYMBOL(pm_suspend);
#endif /* CONFIG_SUSPEND */
-decl_subsys(power, NULL);
-
+struct kset *power_kset;
/**
* state - control system power state.
@@ -386,10 +385,10 @@ static struct attribute_group attr_group = {
static int __init pm_init(void)
{
- int error = subsystem_register(&power_subsys);
- if (!error)
- error = sysfs_create_group(&power_subsys.kobj,&attr_group);
- return error;
+ power_kset = kset_create_and_add("power", NULL, NULL);
+ if (!power_kset)
+ return -ENOMEM;
+ return sysfs_create_group(&power_kset->kobj, &attr_group);
}
core_initcall(pm_init);
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 195dc461176..1083e6b188a 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -63,8 +63,6 @@ static struct subsys_attribute _name##_attr = { \
.store = _name##_store, \
}
-extern struct kset power_subsys;
-
/* Preferred image size in bytes (default 500 MB) */
extern unsigned long image_size;
extern int in_suspend;