summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/cpuidle44xx.c
diff options
context:
space:
mode:
authorSantosh Shilimkar2013-03-25 11:05:05 +0100
committerKevin Hilman2013-04-09 18:45:45 +0200
commit63b951ed5b82c2891982437d1f57cb94dc0b3757 (patch)
treec46595fae5a5691dacc7baf046d2af476209818d /arch/arm/mach-omap2/cpuidle44xx.c
parentARM: OMAP4: CPUidle: Avoid double idle driver registration (diff)
downloadkernel-qcow2-linux-63b951ed5b82c2891982437d1f57cb94dc0b3757.tar.gz
kernel-qcow2-linux-63b951ed5b82c2891982437d1f57cb94dc0b3757.tar.xz
kernel-qcow2-linux-63b951ed5b82c2891982437d1f57cb94dc0b3757.zip
ARM: OMAP: CPUidle: Unregister drivere on device registration failure
If the CPUidle device registration fails for some reason, we should unregister the driver on error path. Fix the code accordingly. Also when at it, check of the driver registration failure too. Acked-by: Nishanth Menon <nm@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Signed-off-by: Kevin Hilman <khilman@linaro.org>
Diffstat (limited to 'arch/arm/mach-omap2/cpuidle44xx.c')
-rw-r--r--arch/arm/mach-omap2/cpuidle44xx.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/cpuidle44xx.c b/arch/arm/mach-omap2/cpuidle44xx.c
index 72c5407fdd12..aeeb8e61406e 100644
--- a/arch/arm/mach-omap2/cpuidle44xx.c
+++ b/arch/arm/mach-omap2/cpuidle44xx.c
@@ -222,7 +222,10 @@ int __init omap4_idle_init(void)
if (!cpu_clkdm[0] || !cpu_clkdm[1])
return -ENODEV;
- cpuidle_register_driver(&omap4_idle_driver);
+ if (cpuidle_register_driver(&omap4_idle_driver)) {
+ pr_err("%s: CPUidle driver register failed\n", __func__);
+ return -EIO;
+ }
for_each_cpu(cpu_id, cpu_online_mask) {
dev = &per_cpu(omap4_idle_dev, cpu_id);
@@ -232,6 +235,7 @@ int __init omap4_idle_init(void)
#endif
if (cpuidle_register_device(dev)) {
pr_err("%s: CPUidle register failed\n", __func__);
+ cpuidle_unregister_driver(&omap4_idle_driver);
return -EIO;
}
}