aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2012-05-17 18:19:42 -0400
committerKukjin Kim <kgene.kim@samsung.com>2012-05-17 18:19:42 -0400
commit4c8b20752893d58bc7b6489c0610951076b0fce8 (patch)
treee6956dc136bae5d1be137e6408a8c8098e5e7e67 /arch
parent36be50515fe2aef61533b516fa2576a2c7fe7664 (diff)
ARM: S3C64XX: declare the states with the new api on cpuidle
The states are now part of the cpuidle_driver structure, so we can declare the states in this structure directly. That saves us an extra variable declaration and a memcpy. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Tested-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s3c64xx/cpuidle.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/arch/arm/mach-s3c64xx/cpuidle.c b/arch/arm/mach-s3c64xx/cpuidle.c
index 179460f38db7..2750e5412cee 100644
--- a/arch/arm/mach-s3c64xx/cpuidle.c
+++ b/arch/arm/mach-s3c64xx/cpuidle.c
@@ -51,33 +51,28 @@ static int s3c64xx_enter_idle(struct cpuidle_device *dev,
51 return index; 51 return index;
52} 52}
53 53
54static struct cpuidle_state s3c64xx_cpuidle_set[] = { 54static DEFINE_PER_CPU(struct cpuidle_device, s3c64xx_cpuidle_device);
55 [0] = {
56 .enter = s3c64xx_enter_idle,
57 .exit_latency = 1,
58 .target_residency = 1,
59 .flags = CPUIDLE_FLAG_TIME_VALID,
60 .name = "IDLE",
61 .desc = "System active, ARM gated",
62 },
63};
64 55
65static struct cpuidle_driver s3c64xx_cpuidle_driver = { 56static struct cpuidle_driver s3c64xx_cpuidle_driver = {
66 .name = "s3c64xx_cpuidle", 57 .name = "s3c64xx_cpuidle",
67 .owner = THIS_MODULE, 58 .owner = THIS_MODULE,
68 .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), 59 .states = {
69}; 60 {
70 61 .enter = s3c64xx_enter_idle,
71static struct cpuidle_device s3c64xx_cpuidle_device = { 62 .exit_latency = 1,
72 .state_count = ARRAY_SIZE(s3c64xx_cpuidle_set), 63 .target_residency = 1,
64 .flags = CPUIDLE_FLAG_TIME_VALID,
65 .name = "IDLE",
66 .desc = "System active, ARM gated",
67 },
68 },
69 .state_count = 1,
73}; 70};
74 71
75static int __init s3c64xx_init_cpuidle(void) 72static int __init s3c64xx_init_cpuidle(void)
76{ 73{
77 int ret; 74 int ret;
78 75
79 memcpy(s3c64xx_cpuidle_driver.states, s3c64xx_cpuidle_set,
80 sizeof(s3c64xx_cpuidle_set));
81 cpuidle_register_driver(&s3c64xx_cpuidle_driver); 76 cpuidle_register_driver(&s3c64xx_cpuidle_driver);
82 77
83 ret = cpuidle_register_device(&s3c64xx_cpuidle_device); 78 ret = cpuidle_register_device(&s3c64xx_cpuidle_device);