aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-04-23 04:54:41 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-23 07:45:23 -0400
commitf040c26ffaa5e56f2bca427c719c9601a02e70e5 (patch)
tree5cda56cd7ee40da7af719ed6719b8ba3bb0629b2 /arch
parentc5106c9dea9a6022ab84c6cb1d4a0b19fc5af0e2 (diff)
ARM: tegra: cpuidle: use init/exit common routine for tegra3
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')
-rw-r--r--arch/arm/mach-tegra/cpuidle-tegra30.c27
1 files changed, 1 insertions, 26 deletions
diff --git a/arch/arm/mach-tegra/cpuidle-tegra30.c b/arch/arm/mach-tegra/cpuidle-tegra30.c
index f6a0c7291c35..36dc2befa9d8 100644
--- a/arch/arm/mach-tegra/cpuidle-tegra30.c
+++ b/arch/arm/mach-tegra/cpuidle-tegra30.c
@@ -64,8 +64,6 @@ static struct cpuidle_driver tegra_idle_driver = {
64 }, 64 },
65}; 65};
66 66
67static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
68
69#ifdef CONFIG_PM_SLEEP 67#ifdef CONFIG_PM_SLEEP
70static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev, 68static bool tegra30_cpu_cluster_power_down(struct cpuidle_device *dev,
71 struct cpuidle_driver *drv, 69 struct cpuidle_driver *drv,
@@ -156,31 +154,8 @@ static int tegra30_idle_lp2(struct cpuidle_device *dev,
156 154
157int __init tegra30_cpuidle_init(void) 155int __init tegra30_cpuidle_init(void)
158{ 156{
159 int ret;
160 unsigned int cpu;
161 struct cpuidle_device *dev;
162 struct cpuidle_driver *drv = &tegra_idle_driver;
163
164#ifdef CONFIG_PM_SLEEP 157#ifdef CONFIG_PM_SLEEP
165 tegra_tear_down_cpu = tegra30_tear_down_cpu; 158 tegra_tear_down_cpu = tegra30_tear_down_cpu;
166#endif 159#endif
167 160 return cpuidle_register(&tegra_idle_driver, NULL);
168 ret = cpuidle_register_driver(&tegra_idle_driver);
169 if (ret) {
170 pr_err("CPUidle driver registration failed\n");
171 return ret;
172 }
173
174 for_each_possible_cpu(cpu) {
175 dev = &per_cpu(tegra_idle_device, cpu);
176 dev->cpu = cpu;
177
178 ret = cpuidle_register_device(dev);
179 if (ret) {
180 pr_err("CPU%u: CPUidle device registration failed\n",
181 cpu);
182 return ret;
183 }
184 }
185 return 0;
186} 161}