aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pv210
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-22 16:03:21 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-24 13:16:10 -0400
commitbb072c3cf21d1c9a5a2eeb5a00679ee7bf39675b (patch)
tree8b9b425422e11c5cb5012adf68e9e2a3e957358f /arch/arm/mach-s5pv210
parent2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (diff)
ARM / Samsung: Use struct syscore_ops for "core" power management
Replace sysdev classes and struct sys_device objects used for "core" power management by Samsung platforms with struct syscore_ops objects that are simpler. This generally reduces the code size and the kernel memory footprint. It also is necessary for removing sysdevs entirely from the kernel in the future. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210')
-rw-r--r--arch/arm/mach-s5pv210/pm.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c
index 549d7924fd4c..24febae3d4c0 100644
--- a/arch/arm/mach-s5pv210/pm.c
+++ b/arch/arm/mach-s5pv210/pm.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/suspend.h> 18#include <linux/suspend.h>
19#include <linux/syscore_ops.h>
19#include <linux/io.h> 20#include <linux/io.h>
20 21
21#include <plat/cpu.h> 22#include <plat/cpu.h>
@@ -140,7 +141,17 @@ static int s5pv210_pm_add(struct sys_device *sysdev)
140 return 0; 141 return 0;
141} 142}
142 143
143static int s5pv210_pm_resume(struct sys_device *dev) 144static struct sysdev_driver s5pv210_pm_driver = {
145 .add = s5pv210_pm_add,
146};
147
148static __init int s5pv210_pm_drvinit(void)
149{
150 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver);
151}
152arch_initcall(s5pv210_pm_drvinit);
153
154static void s5pv210_pm_resume(void)
144{ 155{
145 u32 tmp; 156 u32 tmp;
146 157
@@ -150,17 +161,15 @@ static int s5pv210_pm_resume(struct sys_device *dev)
150 __raw_writel(tmp , S5P_OTHERS); 161 __raw_writel(tmp , S5P_OTHERS);
151 162
152 s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); 163 s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save));
153
154 return 0;
155} 164}
156 165
157static struct sysdev_driver s5pv210_pm_driver = { 166static struct syscore_ops s5pv210_pm_syscore_ops = {
158 .add = s5pv210_pm_add,
159 .resume = s5pv210_pm_resume, 167 .resume = s5pv210_pm_resume,
160}; 168};
161 169
162static __init int s5pv210_pm_drvinit(void) 170static __init int s5pv210_pm_syscore_init(void)
163{ 171{
164 return sysdev_driver_register(&s5pv210_sysclass, &s5pv210_pm_driver); 172 register_syscore_ops(&s5pv210_pm_syscore_ops);
173 return 0;
165} 174}
166arch_initcall(s5pv210_pm_drvinit); 175arch_initcall(s5pv210_pm_syscore_init);