diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-04-23 04:54:36 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-23 07:45:22 -0400 |
commit | 472a85f762da0cf4c72d216b13342e8c15c86bc8 (patch) | |
tree | 574df274ef0219af9cd95f000f89bf006c8d54c0 /arch/arm/mach-omap2/cpuidle34xx.c | |
parent | 22f5d1fa0886355ab8a1a25978c43905ad7a4ec5 (diff) |
ARM: OMAP3: cpuidle: use init/exit common routine
Remove the duplicated code and use the cpuidle common code for initialization.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 20785b2b0ec8..cca045c95fbf 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/cpuidle.h> | 26 | #include <linux/cpuidle.h> |
27 | #include <linux/export.h> | 27 | #include <linux/export.h> |
28 | #include <linux/cpu_pm.h> | 28 | #include <linux/cpu_pm.h> |
29 | #include <asm/cpuidle.h> | ||
29 | 30 | ||
30 | #include "powerdomain.h" | 31 | #include "powerdomain.h" |
31 | #include "clockdomain.h" | 32 | #include "clockdomain.h" |
@@ -259,8 +260,6 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, | |||
259 | return ret; | 260 | return ret; |
260 | } | 261 | } |
261 | 262 | ||
262 | static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); | ||
263 | |||
264 | static struct cpuidle_driver omap3_idle_driver = { | 263 | static struct cpuidle_driver omap3_idle_driver = { |
265 | .name = "omap3_idle", | 264 | .name = "omap3_idle", |
266 | .owner = THIS_MODULE, | 265 | .owner = THIS_MODULE, |
@@ -336,8 +335,6 @@ static struct cpuidle_driver omap3_idle_driver = { | |||
336 | */ | 335 | */ |
337 | int __init omap3_idle_init(void) | 336 | int __init omap3_idle_init(void) |
338 | { | 337 | { |
339 | struct cpuidle_device *dev; | ||
340 | |||
341 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); | 338 | mpu_pd = pwrdm_lookup("mpu_pwrdm"); |
342 | core_pd = pwrdm_lookup("core_pwrdm"); | 339 | core_pd = pwrdm_lookup("core_pwrdm"); |
343 | per_pd = pwrdm_lookup("per_pwrdm"); | 340 | per_pd = pwrdm_lookup("per_pwrdm"); |
@@ -346,20 +343,5 @@ int __init omap3_idle_init(void) | |||
346 | if (!mpu_pd || !core_pd || !per_pd || !cam_pd) | 343 | if (!mpu_pd || !core_pd || !per_pd || !cam_pd) |
347 | return -ENODEV; | 344 | return -ENODEV; |
348 | 345 | ||
349 | if (cpuidle_register_driver(&omap3_idle_driver)) { | 346 | return cpuidle_register(&omap3_idle_driver, NULL); |
350 | pr_err("%s: CPUidle driver register failed\n", __func__); | ||
351 | return -EIO; | ||
352 | } | ||
353 | |||
354 | dev = &per_cpu(omap3_idle_dev, smp_processor_id()); | ||
355 | dev->cpu = 0; | ||
356 | |||
357 | if (cpuidle_register_device(dev)) { | ||
358 | printk(KERN_ERR "%s: CPUidle register device failed\n", | ||
359 | __func__); | ||
360 | cpuidle_unregister_driver(&omap3_idle_driver); | ||
361 | return -EIO; | ||
362 | } | ||
363 | |||
364 | return 0; | ||
365 | } | 347 | } |