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>
This commit is contained in:
parent
0e9e8b4b91
commit
c5106c9dea
1 changed files with 1 additions and 29 deletions
|
@ -70,8 +70,6 @@ static struct cpuidle_driver tegra_idle_driver = {
|
||||||
.safe_state_index = 0,
|
.safe_state_index = 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
static DEFINE_PER_CPU(struct cpuidle_device, tegra_idle_device);
|
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
#ifdef CONFIG_SMP
|
#ifdef CONFIG_SMP
|
||||||
static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
|
static void __iomem *pmc = IO_ADDRESS(TEGRA_PMC_BASE);
|
||||||
|
@ -220,34 +218,8 @@ static int tegra20_idle_lp2_coupled(struct cpuidle_device *dev,
|
||||||
|
|
||||||
int __init tegra20_cpuidle_init(void)
|
int __init tegra20_cpuidle_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
|
||||||
unsigned int cpu;
|
|
||||||
struct cpuidle_device *dev;
|
|
||||||
struct cpuidle_driver *drv = &tegra_idle_driver;
|
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
tegra_tear_down_cpu = tegra20_tear_down_cpu;
|
tegra_tear_down_cpu = tegra20_tear_down_cpu;
|
||||||
#endif
|
#endif
|
||||||
|
return cpuidle_register(&tegra_idle_driver, cpu_possible_mask);
|
||||||
ret = cpuidle_register_driver(&tegra_idle_driver);
|
|
||||||
if (ret) {
|
|
||||||
pr_err("CPUidle driver registration failed\n");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
for_each_possible_cpu(cpu) {
|
|
||||||
dev = &per_cpu(tegra_idle_device, cpu);
|
|
||||||
dev->cpu = cpu;
|
|
||||||
#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
|
|
||||||
dev->coupled_cpus = *cpu_possible_mask;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = cpuidle_register_device(dev);
|
|
||||||
if (ret) {
|
|
||||||
pr_err("CPU%u: CPUidle device registration failed\n",
|
|
||||||
cpu);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue