aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2007-11-02 16:20:40 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-01-24 23:40:20 -0500
commit79393fc46ede43451a500a132e5de9856f5a4c83 (patch)
tree4ef24cf1009eeeef14a0a48d41f1b40e9d2f3933 /arch
parent851324c6ffdf94976b4a925d0684a4faa993b9ca (diff)
kobject: convert pseries/power.c to kobj_attr interface
This makes the code a bit simpler and and gets us one step closer to deleting the deprecated subsys_attr code. Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Manish Ahuja <mahuja@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/platforms/pseries/power.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/arch/powerpc/platforms/pseries/power.c b/arch/powerpc/platforms/pseries/power.c
index c36febe7ce7d..90706cf840fd 100644
--- a/arch/powerpc/platforms/pseries/power.c
+++ b/arch/powerpc/platforms/pseries/power.c
@@ -28,13 +28,15 @@
28 28
29unsigned long rtas_poweron_auto; /* default and normal state is 0 */ 29unsigned long rtas_poweron_auto; /* default and normal state is 0 */
30 30
31static ssize_t auto_poweron_show(struct kset *kset, char *buf) 31static ssize_t auto_poweron_show(struct kobject *kobj,
32 struct kobj_attribute *attr, char *buf)
32{ 33{
33 return sprintf(buf, "%lu\n", rtas_poweron_auto); 34 return sprintf(buf, "%lu\n", rtas_poweron_auto);
34} 35}
35 36
36static ssize_t 37static ssize_t auto_poweron_store(struct kobject *kobj,
37auto_poweron_store(struct kset *kset, const char *buf, size_t n) 38 struct kobj_attribute *attr,
39 const char *buf, size_t n)
38{ 40{
39 int ret; 41 int ret;
40 unsigned long ups_restart; 42 unsigned long ups_restart;
@@ -47,14 +49,8 @@ auto_poweron_store(struct kset *kset, const char *buf, size_t n)
47 return -EINVAL; 49 return -EINVAL;
48} 50}
49 51
50static struct subsys_attribute auto_poweron_attr = { 52static struct kobj_attribute auto_poweron_attr =
51 .attr = { 53 __ATTR(auto_poweron, 0644, auto_poweron_show, auto_poweron_store);
52 .name = __stringify(auto_poweron),
53 .mode = 0644,
54 },
55 .show = auto_poweron_show,
56 .store = auto_poweron_store,
57};
58 54
59#ifndef CONFIG_PM 55#ifndef CONFIG_PM
60struct kset *power_kset; 56struct kset *power_kset;
@@ -79,7 +75,7 @@ core_initcall(pm_init);
79#else 75#else
80static int __init apo_pm_init(void) 76static int __init apo_pm_init(void)
81{ 77{
82 return (subsys_create_file(power_kset, &auto_poweron_attr)); 78 return (sysfs_create_file(&power_kset->kobj, &auto_poweron_attr));
83} 79}
84__initcall(apo_pm_init); 80__initcall(apo_pm_init);
85#endif 81#endif