diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-04-23 04:54:34 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-23 07:45:22 -0400 |
commit | e8928e2e1ec2e3325a90bcc19746ea67cc4bb083 (patch) | |
tree | c8a4b5b44d64c5b1b5cbe1b7aec091ae88bb7b07 /arch/arm/mach-ux500/cpuidle.c | |
parent | 4c637b2175a0dc65d533494225525c6c82d73293 (diff) |
ARM: ux500: cpuidle: use init/exit common routine
Remove the duplicate code and use the cpuidle common code for initialization.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-ux500/cpuidle.c')
-rw-r--r-- | arch/arm/mach-ux500/cpuidle.c | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/arch/arm/mach-ux500/cpuidle.c b/arch/arm/mach-ux500/cpuidle.c index 5657d4af301c..488e07472d98 100644 --- a/arch/arm/mach-ux500/cpuidle.c +++ b/arch/arm/mach-ux500/cpuidle.c | |||
@@ -21,7 +21,6 @@ | |||
21 | 21 | ||
22 | static atomic_t master = ATOMIC_INIT(0); | 22 | static atomic_t master = ATOMIC_INIT(0); |
23 | static DEFINE_SPINLOCK(master_lock); | 23 | static DEFINE_SPINLOCK(master_lock); |
24 | static DEFINE_PER_CPU(struct cpuidle_device, ux500_cpuidle_device); | ||
25 | 24 | ||
26 | static inline int ux500_enter_idle(struct cpuidle_device *dev, | 25 | static inline int ux500_enter_idle(struct cpuidle_device *dev, |
27 | struct cpuidle_driver *drv, int index) | 26 | struct cpuidle_driver *drv, int index) |
@@ -112,40 +111,11 @@ static struct cpuidle_driver ux500_idle_driver = { | |||
112 | 111 | ||
113 | int __init ux500_idle_init(void) | 112 | int __init ux500_idle_init(void) |
114 | { | 113 | { |
115 | int ret, cpu; | ||
116 | struct cpuidle_device *device; | ||
117 | |||
118 | /* Configure wake up reasons */ | 114 | /* Configure wake up reasons */ |
119 | prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | | 115 | prcmu_enable_wakeups(PRCMU_WAKEUP(ARM) | PRCMU_WAKEUP(RTC) | |
120 | PRCMU_WAKEUP(ABB)); | 116 | PRCMU_WAKEUP(ABB)); |
121 | 117 | ||
122 | ret = cpuidle_register_driver(&ux500_idle_driver); | 118 | return cpuidle_register(&ux500_idle_driver, NULL); |
123 | if (ret) { | ||
124 | printk(KERN_ERR "failed to register ux500 idle driver\n"); | ||
125 | return ret; | ||
126 | } | ||
127 | |||
128 | for_each_possible(cpu) { | ||
129 | device = &per_cpu(ux500_cpuidle_device, cpu); | ||
130 | device->cpu = cpu; | ||
131 | ret = cpuidle_register_device(device); | ||
132 | if (ret) { | ||
133 | printk(KERN_ERR "Failed to register cpuidle " | ||
134 | "device for cpu%d\n", cpu); | ||
135 | goto out_unregister; | ||
136 | } | ||
137 | } | ||
138 | out: | ||
139 | return ret; | ||
140 | |||
141 | out_unregister: | ||
142 | for_each_possible_cpu(cpu) { | ||
143 | device = &per_cpu(ux500_cpuidle_device, cpu); | ||
144 | cpuidle_unregister_device(device); | ||
145 | } | ||
146 | |||
147 | cpuidle_unregister_driver(&ux500_idle_driver); | ||
148 | goto out; | ||
149 | } | 119 | } |
150 | 120 | ||
151 | device_initcall(ux500_idle_init); | 121 | device_initcall(ux500_idle_init); |