aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/cm-x2xx.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/cm-x2xx.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/cm-x2xx.c')
-rw-r--r--arch/arm/mach-pxa/cm-x2xx.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c
index 8225e2e58c6e..a10996782476 100644
--- a/arch/arm/mach-pxa/cm-x2xx.c
+++ b/arch/arm/mach-pxa/cm-x2xx.c
@@ -10,7 +10,7 @@
10 */ 10 */
11 11
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/sysdev.h> 13#include <linux/syscore_ops.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/gpio.h> 15#include <linux/gpio.h>
16 16
@@ -388,7 +388,7 @@ static inline void cmx2xx_init_display(void) {}
388#ifdef CONFIG_PM 388#ifdef CONFIG_PM
389static unsigned long sleep_save_msc[10]; 389static unsigned long sleep_save_msc[10];
390 390
391static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) 391static int cmx2xx_suspend(void)
392{ 392{
393 cmx2xx_pci_suspend(); 393 cmx2xx_pci_suspend();
394 394
@@ -412,7 +412,7 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state)
412 return 0; 412 return 0;
413} 413}
414 414
415static int cmx2xx_resume(struct sys_device *dev) 415static void cmx2xx_resume(void)
416{ 416{
417 cmx2xx_pci_resume(); 417 cmx2xx_pci_resume();
418 418
@@ -420,27 +420,18 @@ static int cmx2xx_resume(struct sys_device *dev)
420 __raw_writel(sleep_save_msc[0], MSC0); 420 __raw_writel(sleep_save_msc[0], MSC0);
421 __raw_writel(sleep_save_msc[1], MSC1); 421 __raw_writel(sleep_save_msc[1], MSC1);
422 __raw_writel(sleep_save_msc[2], MSC2); 422 __raw_writel(sleep_save_msc[2], MSC2);
423
424 return 0;
425} 423}
426 424
427static struct sysdev_class cmx2xx_pm_sysclass = { 425static struct syscore_ops cmx2xx_pm_syscore_ops = {
428 .name = "pm",
429 .resume = cmx2xx_resume, 426 .resume = cmx2xx_resume,
430 .suspend = cmx2xx_suspend, 427 .suspend = cmx2xx_suspend,
431}; 428};
432 429
433static struct sys_device cmx2xx_pm_device = {
434 .cls = &cmx2xx_pm_sysclass,
435};
436
437static int __init cmx2xx_pm_init(void) 430static int __init cmx2xx_pm_init(void)
438{ 431{
439 int error; 432 register_syscore_ops(&cmx2xx_pm_syscore_ops);
440 error = sysdev_class_register(&cmx2xx_pm_sysclass); 433
441 if (error == 0) 434 return 0;
442 error = sysdev_register(&cmx2xx_pm_device);
443 return error;
444} 435}
445#else 436#else
446static int __init cmx2xx_pm_init(void) { return 0; } 437static int __init cmx2xx_pm_init(void) { return 0; }