aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/palmz72.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-04-22 16:03:11 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-04-24 13:16:09 -0400
commit2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (patch)
tree9366c07d166eaede876cd7233cc30056f198a93f /arch/arm/mach-pxa/palmz72.c
parent905339807bde7bb726001b69fbdf69ab0cf69a9e (diff)
ARM / PXA: Use struct syscore_ops for "core" power management
Replace sysdev classes and struct sys_device objects used for "core" power management by the PXA platform code with struct syscore_ops objects that are simpler. This 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>
Diffstat (limited to 'arch/arm/mach-pxa/palmz72.c')
-rw-r--r--arch/arm/mach-pxa/palmz72.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c
index 3b8a4f37dbbe..65f24f0b77e8 100644
--- a/arch/arm/mach-pxa/palmz72.c
+++ b/arch/arm/mach-pxa/palmz72.c
@@ -19,7 +19,7 @@
19 */ 19 */
20 20
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/sysdev.h> 22#include <linux/syscore_ops.h>
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/irq.h> 24#include <linux/irq.h>
25#include <linux/gpio_keys.h> 25#include <linux/gpio_keys.h>
@@ -233,9 +233,9 @@ static struct palmz72_resume_info palmz72_resume_info = {
233 233
234static unsigned long store_ptr; 234static unsigned long store_ptr;
235 235
236/* sys_device for Palm Zire 72 PM */ 236/* syscore_ops for Palm Zire 72 PM */
237 237
238static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg) 238static int palmz72_pm_suspend(void)
239{ 239{
240 /* setup the resume_info struct for the original bootloader */ 240 /* setup the resume_info struct for the original bootloader */
241 palmz72_resume_info.resume_addr = (u32) cpu_resume; 241 palmz72_resume_info.resume_addr = (u32) cpu_resume;
@@ -249,31 +249,23 @@ static int palmz72_pm_suspend(struct sys_device *dev, pm_message_t msg)
249 return 0; 249 return 0;
250} 250}
251 251
252static int palmz72_pm_resume(struct sys_device *dev) 252static void palmz72_pm_resume(void)
253{ 253{
254 *PALMZ72_SAVE_DWORD = store_ptr; 254 *PALMZ72_SAVE_DWORD = store_ptr;
255 return 0;
256} 255}
257 256
258static struct sysdev_class palmz72_pm_sysclass = { 257static struct syscore_ops palmz72_pm_syscore_ops = {
259 .name = "palmz72_pm",
260 .suspend = palmz72_pm_suspend, 258 .suspend = palmz72_pm_suspend,
261 .resume = palmz72_pm_resume, 259 .resume = palmz72_pm_resume,
262}; 260};
263 261
264static struct sys_device palmz72_pm_device = {
265 .cls = &palmz72_pm_sysclass,
266};
267
268static int __init palmz72_pm_init(void) 262static int __init palmz72_pm_init(void)
269{ 263{
270 int ret = -ENODEV;
271 if (machine_is_palmz72()) { 264 if (machine_is_palmz72()) {
272 ret = sysdev_class_register(&palmz72_pm_sysclass); 265 register_syscore_ops(&palmz72_pm_syscore_ops);
273 if (ret == 0) 266 return 0;
274 ret = sysdev_register(&palmz72_pm_device);
275 } 267 }
276 return ret; 268 return -ENODEV;
277} 269}
278 270
279device_initcall(palmz72_pm_init); 271device_initcall(palmz72_pm_init);