Skip to content

Commit

Permalink
driver core: make /sys/power a kobject
Browse files Browse the repository at this point in the history
/sys/power should not be a kset, that's overkill.  This patch renames it
to power_kset and fixes up all usages of it in the tree.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent 37b0c02 commit d76e15f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap1/pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ static int __init omap_pm_init(void)
omap_pm_init_proc();
#endif

error = sysfs_create_file(&power_kset->kobj, &sleep_while_idle_attr);
error = sysfs_create_file(power_kobj, &sleep_while_idle_attr);
if (error)
printk(KERN_ERR "sysfs_create_file failed: %d\n", error);

Expand Down
10 changes: 5 additions & 5 deletions arch/powerpc/platforms/pseries/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static struct kobj_attribute auto_poweron_attr =
__ATTR(auto_poweron, 0644, auto_poweron_show, auto_poweron_store);

#ifndef CONFIG_PM
struct kset *power_kset;
struct kobject *power_kobj;

static struct attribute *g[] = {
&auto_poweron_attr.attr,
Expand All @@ -66,16 +66,16 @@ static struct attribute_group attr_group = {

static int __init pm_init(void)
{
power_kset = kset_create_and_add("power", NULL, NULL);
if (!power_kset)
power_kobj = kobject_create_and_add("power", NULL);
if (!power_kobj)
return -ENOMEM;
return sysfs_create_group(&power_kset->kobj, &attr_group);
return sysfs_create_group(power_kobj, &attr_group);
}
core_initcall(pm_init);
#else
static int __init apo_pm_init(void)
{
return (sysfs_create_file(&power_kset->kobj, &auto_poweron_attr));
return (sysfs_create_file(power_kobj, &auto_poweron_attr));
}
__initcall(apo_pm_init);
#endif
4 changes: 2 additions & 2 deletions include/linux/kobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ extern struct kobject * kset_find_obj(struct kset *, const char *);
extern struct kobject *kernel_kobj;
/* The global /sys/hypervisor/ kobject for people to chain off of */
extern struct kobject *hypervisor_kobj;
/* The global /sys/power/ kset for people to chain off of */
extern struct kset *power_kset;
/* The global /sys/power/ kobject for people to chain off of */
extern struct kobject *power_kobj;
/* The global /sys/firmware/ kobject for people to chain off of */
extern struct kobject *firmware_kobj;

Expand Down
2 changes: 1 addition & 1 deletion kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ static struct attribute_group attr_group = {

static int __init pm_disk_init(void)
{
return sysfs_create_group(&power_kset->kobj, &attr_group);
return sysfs_create_group(power_kobj, &attr_group);
}

core_initcall(pm_disk_init);
Expand Down
8 changes: 4 additions & 4 deletions kernel/power/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ EXPORT_SYMBOL(pm_suspend);

#endif /* CONFIG_SUSPEND */

struct kset *power_kset;
struct kobject *power_kobj;

/**
* state - control system power state.
Expand Down Expand Up @@ -389,10 +389,10 @@ static struct attribute_group attr_group = {

static int __init pm_init(void)
{
power_kset = kset_create_and_add("power", NULL, NULL);
if (!power_kset)
power_kobj = kobject_create_and_add("power", NULL);
if (!power_kobj)
return -ENOMEM;
return sysfs_create_group(&power_kset->kobj, &attr_group);
return sysfs_create_group(power_kobj, &attr_group);
}

core_initcall(pm_init);

0 comments on commit d76e15f

Please sign in to comment.