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/mfp-pxa3xx.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/mfp-pxa3xx.c')
-rw-r--r-- | arch/arm/mach-pxa/mfp-pxa3xx.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/arch/arm/mach-pxa/mfp-pxa3xx.c b/arch/arm/mach-pxa/mfp-pxa3xx.c index 7a270eecd480..89863a01ecd7 100644 --- a/arch/arm/mach-pxa/mfp-pxa3xx.c +++ b/arch/arm/mach-pxa/mfp-pxa3xx.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | #include <linux/sysdev.h> | 20 | #include <linux/syscore_ops.h> |
21 | 21 | ||
22 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
23 | #include <mach/mfp-pxa3xx.h> | 23 | #include <mach/mfp-pxa3xx.h> |
@@ -31,13 +31,13 @@ | |||
31 | * a pull-down mode if they're an active low chip select, and we're | 31 | * a pull-down mode if they're an active low chip select, and we're |
32 | * just entering standby. | 32 | * just entering standby. |
33 | */ | 33 | */ |
34 | static int pxa3xx_mfp_suspend(struct sys_device *d, pm_message_t state) | 34 | static int pxa3xx_mfp_suspend(void) |
35 | { | 35 | { |
36 | mfp_config_lpm(); | 36 | mfp_config_lpm(); |
37 | return 0; | 37 | return 0; |
38 | } | 38 | } |
39 | 39 | ||
40 | static int pxa3xx_mfp_resume(struct sys_device *d) | 40 | static void pxa3xx_mfp_resume(void) |
41 | { | 41 | { |
42 | mfp_config_run(); | 42 | mfp_config_run(); |
43 | 43 | ||
@@ -47,24 +47,13 @@ static int pxa3xx_mfp_resume(struct sys_device *d) | |||
47 | * preserve them here in case they will be referenced later | 47 | * preserve them here in case they will be referenced later |
48 | */ | 48 | */ |
49 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | 49 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); |
50 | return 0; | ||
51 | } | 50 | } |
52 | #else | 51 | #else |
53 | #define pxa3xx_mfp_suspend NULL | 52 | #define pxa3xx_mfp_suspend NULL |
54 | #define pxa3xx_mfp_resume NULL | 53 | #define pxa3xx_mfp_resume NULL |
55 | #endif | 54 | #endif |
56 | 55 | ||
57 | struct sysdev_class pxa3xx_mfp_sysclass = { | 56 | struct syscore_ops pxa3xx_mfp_syscore_ops = { |
58 | .name = "mfp", | ||
59 | .suspend = pxa3xx_mfp_suspend, | 57 | .suspend = pxa3xx_mfp_suspend, |
60 | .resume = pxa3xx_mfp_resume, | 58 | .resume = pxa3xx_mfp_resume, |
61 | }; | 59 | }; |
62 | |||
63 | static int __init mfp_init_devicefs(void) | ||
64 | { | ||
65 | if (cpu_is_pxa3xx()) | ||
66 | return sysdev_class_register(&pxa3xx_mfp_sysclass); | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | postcore_initcall(mfp_init_devicefs); | ||