.store = omap_pm_sleep_while_idle_store,
};
-extern struct kset power_subsys;
static void (*omap_sram_idle)(void) = NULL;
static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
omap_pm_init_proc();
#endif
- error = subsys_create_file(&power_subsys, &sleep_while_idle_attr);
+ error = subsys_create_file(power_kset, &sleep_while_idle_attr);
if (error)
printk(KERN_ERR "subsys_create_file failed: %d\n", error);
};
#ifndef CONFIG_PM
-decl_subsys(power, NULL);
+struct kset *power_kset;
static struct attribute *g[] = {
&auto_poweron_attr.attr,
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);
#else
-extern struct kset power_subsys;
-
static int __init apo_pm_init(void)
{
- return (subsys_create_file(&power_subsys, &auto_poweron_attr));
+ return (subsys_create_file(power_kset, &auto_poweron_attr));
}
__initcall(apo_pm_init);
#endif
extern struct kset *kernel_kset;
/* 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;
extern int __must_check subsystem_register(struct kset *);
extern void subsystem_unregister(struct kset *);
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);
#endif /* CONFIG_SUSPEND */
-decl_subsys(power, NULL);
-
+struct kset *power_kset;
/**
* state - control system power state.
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);
.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;