diff options
author | Daniel Lezcano <daniel.lezcano@linaro.org> | 2013-01-19 00:57:58 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2013-04-09 11:12:26 -0400 |
commit | 5db9f436213d81f053e3f6d69d367637b02fe95e (patch) | |
tree | e567e034340e9e32ccb24b7c80c6a8edae0bf56b | |
parent | 2eb89f893e44b1a9f48fa1cb6aa5e0d18ed66bb5 (diff) |
ARM: EXYNOS: handle properly the return values
The cpuidle_register_driver return value is not checked.
The init function returns always -EIO when cpuidle_register_device
fails but the error could be different.
This patch fixes that by checking the cpuidle_register_driver properly
and returning the correct value when cpuidle_register_device fails.
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Amit Daniel Kachhap <amit.daniel@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-exynos/cpuidle.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c index 6ac4069f3c93..a4e50811c9c5 100644 --- a/arch/arm/mach-exynos/cpuidle.c +++ b/arch/arm/mach-exynos/cpuidle.c | |||
@@ -194,13 +194,17 @@ static void __init exynos5_core_down_clk(void) | |||
194 | 194 | ||
195 | static int __init exynos4_init_cpuidle(void) | 195 | static int __init exynos4_init_cpuidle(void) |
196 | { | 196 | { |
197 | int cpu_id; | 197 | int cpu_id, ret; |
198 | struct cpuidle_device *device; | 198 | struct cpuidle_device *device; |
199 | 199 | ||
200 | if (soc_is_exynos5250()) | 200 | if (soc_is_exynos5250()) |
201 | exynos5_core_down_clk(); | 201 | exynos5_core_down_clk(); |
202 | 202 | ||
203 | cpuidle_register_driver(&exynos4_idle_driver); | 203 | ret = cpuidle_register_driver(&exynos4_idle_driver); |
204 | if (ret) { | ||
205 | printk(KERN_ERR "CPUidle failed to register driver\n"); | ||
206 | return ret; | ||
207 | } | ||
204 | 208 | ||
205 | for_each_cpu(cpu_id, cpu_online_mask) { | 209 | for_each_cpu(cpu_id, cpu_online_mask) { |
206 | device = &per_cpu(exynos4_cpuidle_device, cpu_id); | 210 | device = &per_cpu(exynos4_cpuidle_device, cpu_id); |
@@ -210,9 +214,10 @@ static int __init exynos4_init_cpuidle(void) | |||
210 | if (cpu_id != 0) | 214 | if (cpu_id != 0) |
211 | device->state_count = 1; | 215 | device->state_count = 1; |
212 | 216 | ||
213 | if (cpuidle_register_device(device)) { | 217 | ret = cpuidle_register_device(device); |
214 | printk(KERN_ERR "CPUidle register device failed\n,"); | 218 | if (ret) { |
215 | return -EIO; | 219 | printk(KERN_ERR "CPUidle register device failed\n"); |
220 | return ret; | ||
216 | } | 221 | } |
217 | } | 222 | } |
218 | 223 | ||