diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-04-23 04:54:44 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-04-23 07:45:23 -0400 |
commit | 3aec034590d98cb268b3a1f434a602b3d53b0ad2 (patch) | |
tree | c1a3cdb422e156cd13f640e52a16dcd5da9d7a6e /arch/arm/mach-davinci | |
parent | 30dc72c6fa91c640e98ce5ef5ec33fb2beb41ad2 (diff) |
ARM: davinci: 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: Sekhar Nori <nsekhar@ti.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/cpuidle.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index c2887c57c899..36aef3a7dedb 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #define DAVINCI_CPUIDLE_MAX_STATES 2 | 26 | #define DAVINCI_CPUIDLE_MAX_STATES 2 |
27 | 27 | ||
28 | static DEFINE_PER_CPU(struct cpuidle_device, davinci_cpuidle_device); | ||
29 | static void __iomem *ddr2_reg_base; | 28 | static void __iomem *ddr2_reg_base; |
30 | static bool ddr2_pdown; | 29 | static bool ddr2_pdown; |
31 | 30 | ||
@@ -76,12 +75,8 @@ static struct cpuidle_driver davinci_idle_driver = { | |||
76 | 75 | ||
77 | static int __init davinci_cpuidle_probe(struct platform_device *pdev) | 76 | static int __init davinci_cpuidle_probe(struct platform_device *pdev) |
78 | { | 77 | { |
79 | int ret; | ||
80 | struct cpuidle_device *device; | ||
81 | struct davinci_cpuidle_config *pdata = pdev->dev.platform_data; | 78 | struct davinci_cpuidle_config *pdata = pdev->dev.platform_data; |
82 | 79 | ||
83 | device = &per_cpu(davinci_cpuidle_device, smp_processor_id()); | ||
84 | |||
85 | if (!pdata) { | 80 | if (!pdata) { |
86 | dev_err(&pdev->dev, "cannot get platform data\n"); | 81 | dev_err(&pdev->dev, "cannot get platform data\n"); |
87 | return -ENOENT; | 82 | return -ENOENT; |
@@ -91,20 +86,7 @@ static int __init davinci_cpuidle_probe(struct platform_device *pdev) | |||
91 | 86 | ||
92 | ddr2_pdown = pdata->ddr2_pdown; | 87 | ddr2_pdown = pdata->ddr2_pdown; |
93 | 88 | ||
94 | ret = cpuidle_register_driver(&davinci_idle_driver); | 89 | return cpuidle_register(&davinci_idle_driver, NULL); |
95 | if (ret) { | ||
96 | dev_err(&pdev->dev, "failed to register driver\n"); | ||
97 | return ret; | ||
98 | } | ||
99 | |||
100 | ret = cpuidle_register_device(device); | ||
101 | if (ret) { | ||
102 | dev_err(&pdev->dev, "failed to register device\n"); | ||
103 | cpuidle_unregister_driver(&davinci_idle_driver); | ||
104 | return ret; | ||
105 | } | ||
106 | |||
107 | return 0; | ||
108 | } | 90 | } |
109 | 91 | ||
110 | static struct platform_driver davinci_cpuidle_driver = { | 92 | static struct platform_driver davinci_cpuidle_driver = { |