diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-04-23 04:54:40 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-23 07:45:23 -0400 |
commit | c5106c9dea9a6022ab84c6cb1d4a0b19fc5af0e2 (patch) | |
tree | 4a45b9c2441dd1c6f45e6102b3d40af898ab62b9 /arch/arm/mach-tegra/cpuidle-tegra20.c | |
parent | 0e9e8b4b918a7d2fc622bc93ee77e82ecae37d40 (diff) |
ARM: tegra: cpuidle: use init/exit common routine for tegra2
Remove the duplicated code and use the cpuidle common code for initialization.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-tegra/cpuidle-tegra20.c')
-rw-r--r-- | arch/arm/mach-tegra/cpuidle-tegra20.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-tegra20.c b/arch/arm/mach-tegra/cpuidle-tegra20.c index f1f6ac40d714..590ec25855dd 100644 --- a/arch/arm/mach-tegra/cpuidle-tegra20.c +++ b/arch/arm/mach-tegra/cpuidle-tegra20.c | |||
@@ -70,8 +70,6 @@ static struct cpuidle_driver tegra_idle_driver = { | |||
70 | .safe_state_index = 0, | 70 | .safe_state_index = 0, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device); | ||
74 | |||
75 | #ifdef CONFIG_PM_SLEEP | 73 | #ifdef CONFIG_PM_SLEEP |
76 | #ifdef CONFIG_SMP | 74 | #ifdef CONFIG_SMP |
77 | static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); | 75 | static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE); |
@@ -220,34 +218,8 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev, | |||
220 | 218 | ||
221 | int __init tegra20_cpuidle_init(void) | 219 | int __init tegra20_cpuidle_init(void) |
222 | { | 220 | { |
223 | int ret; | ||
224 | unsigned int cpu; | ||
225 | struct cpuidle_device *dev; | ||
226 | struct cpuidle_driver *drv = &tegra_idle_driver; | ||
227 | |||
228 | #ifdef CONFIG_PM_SLEEP | 221 | #ifdef CONFIG_PM_SLEEP |
229 | tegra_tear_down_cpu = tegra20_tear_down_cpu; | 222 | tegra_tear_down_cpu = tegra20_tear_down_cpu; |
230 | #endif | 223 | #endif |
231 | 224 | return cpuidle_register(&tegra_idle_driver, cpu_possible_mask); | |
232 | ret = cpuidle_register_driver(&tegra_idle_driver); | ||
233 | if (ret) { | ||
234 | pr_err("CPUidle driver registration failed\n"); | ||
235 | return ret; | ||
236 | } | ||
237 | |||
238 | for_each_possible_cpu(cpu) { | ||
239 | dev = &per_cpu(tegra_idle_device, cpu); | ||
240 | dev->cpu = cpu; | ||
241 | #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED | ||
242 | dev->coupled_cpus = *cpu_possible_mask; | ||
243 | #endif | ||
244 | |||
245 | ret = cpuidle_register_device(dev); | ||
246 | if (ret) { | ||
247 | pr_err("CPU%u: CPUidle device registration failed\n", | ||
248 | cpu); | ||
249 | return ret; | ||
250 | } | ||
251 | } | ||
252 | return 0; | ||
253 | } | 225 | } |