summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cpuidle34xx.c
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-04-23 08:54:36 +0000
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-04-23 13:45:22 +0200
commit472a85f762da0cf4c72d216b13342e8c15c86bc8 (patch)
tree574df274ef0219af9cd95f000f89bf006c8d54c0 /arch/arm/mach-omap2/cpuidle34xx.c
parent22f5d1fa0886355ab8a1a25978c43905ad7a4ec5 (diff)
downloadlinux-472a85f762da0cf4c72d216b13342e8c15c86bc8.tar.gz
linux-472a85f762da0cf4c72d216b13342e8c15c86bc8.tar.bz2
linux-472a85f762da0cf4c72d216b13342e8c15c86bc8.zip
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.c22
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 @@
#include <linux/cpuidle.h>
#include <linux/export.h>
#include <linux/cpu_pm.h>
+#include <asm/cpuidle.h>
#include "powerdomain.h"
#include "clockdomain.h"
@@ -259,8 +260,6 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
return ret;
}
-static DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev);
-
static struct cpuidle_driver omap3_idle_driver = {
.name = "omap3_idle",
.owner = THIS_MODULE,
@@ -336,8 +335,6 @@ static struct cpuidle_driver omap3_idle_driver = {
*/
int __init omap3_idle_init(void)
{
- struct cpuidle_device *dev;
-
mpu_pd = pwrdm_lookup("mpu_pwrdm");
core_pd = pwrdm_lookup("core_pwrdm");
per_pd = pwrdm_lookup("per_pwrdm");
@@ -346,20 +343,5 @@ int __init omap3_idle_init(void)
if (!mpu_pd || !core_pd || !per_pd || !cam_pd)
return -ENODEV;
- if (cpuidle_register_driver(&omap3_idle_driver)) {
- pr_err("%s: CPUidle driver register failed\n", __func__);
- return -EIO;
- }
-
- dev = &per_cpu(omap3_idle_dev, smp_processor_id());
- dev->cpu = 0;
-
- if (cpuidle_register_device(dev)) {
- printk(KERN_ERR "%s: CPUidle register device failed\n",
- __func__);
- cpuidle_unregister_driver(&omap3_idle_driver);
- return -EIO;
- }
-
- return 0;
+ return cpuidle_register(&omap3_idle_driver, NULL);
}