diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-22 16:03:11 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-24 13:16:09 -0400 |
commit | 2eaa03b5bebd1e80014f780d7bf27c3e66daefd6 (patch) | |
tree | 9366c07d166eaede876cd7233cc30056f198a93f /arch/arm/mach-pxa/smemc.c | |
parent | 905339807bde7bb726001b69fbdf69ab0cf69a9e (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/smemc.c')
-rw-r--r-- | arch/arm/mach-pxa/smemc.c | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c index 232b7316ec08..79923058d10f 100644 --- a/arch/arm/mach-pxa/smemc.c +++ b/arch/arm/mach-pxa/smemc.c | |||
@@ -6,7 +6,7 @@ | |||
6 | #include <linux/kernel.h> | 6 | #include <linux/kernel.h> |
7 | #include <linux/init.h> | 7 | #include <linux/init.h> |
8 | #include <linux/io.h> | 8 | #include <linux/io.h> |
9 | #include <linux/sysdev.h> | 9 | #include <linux/syscore_ops.h> |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | #include <mach/smemc.h> | 12 | #include <mach/smemc.h> |
@@ -16,7 +16,7 @@ static unsigned long msc[2]; | |||
16 | static unsigned long sxcnfg, memclkcfg; | 16 | static unsigned long sxcnfg, memclkcfg; |
17 | static unsigned long csadrcfg[4]; | 17 | static unsigned long csadrcfg[4]; |
18 | 18 | ||
19 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | 19 | static int pxa3xx_smemc_suspend(void) |
20 | { | 20 | { |
21 | msc[0] = __raw_readl(MSC0); | 21 | msc[0] = __raw_readl(MSC0); |
22 | msc[1] = __raw_readl(MSC1); | 22 | msc[1] = __raw_readl(MSC1); |
@@ -30,7 +30,7 @@ static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | |||
30 | return 0; | 30 | return 0; |
31 | } | 31 | } |
32 | 32 | ||
33 | static int pxa3xx_smemc_resume(struct sys_device *dev) | 33 | static void pxa3xx_smemc_resume(void) |
34 | { | 34 | { |
35 | __raw_writel(msc[0], MSC0); | 35 | __raw_writel(msc[0], MSC0); |
36 | __raw_writel(msc[1], MSC1); | 36 | __raw_writel(msc[1], MSC1); |
@@ -40,34 +40,19 @@ static int pxa3xx_smemc_resume(struct sys_device *dev) | |||
40 | __raw_writel(csadrcfg[1], CSADRCFG1); | 40 | __raw_writel(csadrcfg[1], CSADRCFG1); |
41 | __raw_writel(csadrcfg[2], CSADRCFG2); | 41 | __raw_writel(csadrcfg[2], CSADRCFG2); |
42 | __raw_writel(csadrcfg[3], CSADRCFG3); | 42 | __raw_writel(csadrcfg[3], CSADRCFG3); |
43 | |||
44 | return 0; | ||
45 | } | 43 | } |
46 | 44 | ||
47 | static struct sysdev_class smemc_sysclass = { | 45 | static struct syscore_ops smemc_syscore_ops = { |
48 | .name = "smemc", | ||
49 | .suspend = pxa3xx_smemc_suspend, | 46 | .suspend = pxa3xx_smemc_suspend, |
50 | .resume = pxa3xx_smemc_resume, | 47 | .resume = pxa3xx_smemc_resume, |
51 | }; | 48 | }; |
52 | 49 | ||
53 | static struct sys_device smemc_sysdev = { | ||
54 | .id = 0, | ||
55 | .cls = &smemc_sysclass, | ||
56 | }; | ||
57 | |||
58 | static int __init smemc_init(void) | 50 | static int __init smemc_init(void) |
59 | { | 51 | { |
60 | int ret = 0; | 52 | if (cpu_is_pxa3xx()) |
53 | register_syscore_ops(&smemc_syscore_ops); | ||
61 | 54 | ||
62 | if (cpu_is_pxa3xx()) { | 55 | return 0; |
63 | ret = sysdev_class_register(&smemc_sysclass); | ||
64 | if (ret) | ||
65 | return ret; | ||
66 | |||
67 | ret = sysdev_register(&smemc_sysdev); | ||
68 | } | ||
69 | |||
70 | return ret; | ||
71 | } | 56 | } |
72 | subsys_initcall(smemc_init); | 57 | subsys_initcall(smemc_init); |
73 | #endif | 58 | #endif |