aboutsummaryrefslogtreecommitdiffstats
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:19 -0500
commit851324c6ffdf94976b4a925d0684a4faa993b9ca (patch)
tree8838773621269c65450aa8a7b0ae04efc7c6eb81
parent66ac831e03879c3c7dae76f793e6094e407081d2 (diff)
kobject: convert arm/mach-omap1/pm.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: Cliff Brake <cbrake@accelent.com> Cc: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--arch/arm/mach-omap1/pm.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 402113c72981..63edafb59490 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -69,14 +69,14 @@ static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
69 69
70static unsigned short enable_dyn_sleep = 1; 70static unsigned short enable_dyn_sleep = 1;
71 71
72static ssize_t omap_pm_sleep_while_idle_show(struct kset *kset, char *buf) 72static ssize_t idle_show(struct kobject *kobj, struct kobj_attribute *attr,
73 char *buf)
73{ 74{
74 return sprintf(buf, "%hu\n", enable_dyn_sleep); 75 return sprintf(buf, "%hu\n", enable_dyn_sleep);
75} 76}
76 77
77static ssize_t omap_pm_sleep_while_idle_store(struct kset *kset, 78static ssize_t idle_store(struct kobject *kobj, struct kobj_attribute *attr,
78 const char * buf, 79 const char * buf, size_t n)
79 size_t n)
80{ 80{
81 unsigned short value; 81 unsigned short value;
82 if (sscanf(buf, "%hu", &value) != 1 || 82 if (sscanf(buf, "%hu", &value) != 1 ||
@@ -88,14 +88,8 @@ static ssize_t omap_pm_sleep_while_idle_store(struct kset *kset,
88 return n; 88 return n;
89} 89}
90 90
91static struct subsys_attribute sleep_while_idle_attr = { 91static struct kobj_attribute sleep_while_idle_attr =
92 .attr = { 92 __ATTR(sleep_while_idle, 0644, idle_show, idle_store);
93 .name = __stringify(sleep_while_idle),
94 .mode = 0644,
95 },
96 .show = omap_pm_sleep_while_idle_show,
97 .store = omap_pm_sleep_while_idle_store,
98};
99 93
100static void (*omap_sram_idle)(void) = NULL; 94static void (*omap_sram_idle)(void) = NULL;
101static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 95static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
@@ -725,9 +719,9 @@ static int __init omap_pm_init(void)
725 omap_pm_init_proc(); 719 omap_pm_init_proc();
726#endif 720#endif
727 721
728 error = subsys_create_file(power_kset, &sleep_while_idle_attr); 722 error = sysfs_create_file(&power_kset->kobj, &sleep_while_idle_attr);
729 if (error) 723 if (error)
730 printk(KERN_ERR "subsys_create_file failed: %d\n", error); 724 printk(KERN_ERR "sysfs_create_file failed: %d\n", error);
731 725
732 if (cpu_is_omap16xx()) { 726 if (cpu_is_omap16xx()) {
733 /* configure LOW_PWR pin */ 727 /* configure LOW_PWR pin */