diff options
author | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2013-03-25 15:35:05 +0530 |
---|---|---|
committer | Kevin Hilman <khilman@linaro.org> | 2013-04-09 09:45:45 -0700 |
commit | 63b951ed5b82c2891982437d1f57cb94dc0b3757 (patch) | |
tree | c46595fae5a5691dacc7baf046d2af476209818d /arch/arm/mach-omap2/cpuidle34xx.c | |
parent | dbd1ba6a62408520e5c7a024b521af14e71b2987 (diff) |
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/cpuidle34xx.c')
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 4f67a5b9bc52..a300122caddd 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -359,7 +359,10 @@ int __init omap3_idle_init(void) if (!mpu_pd || !core_pd || !per_pd || !cam_pd) return -ENODEV; - cpuidle_register_driver(&omap3_idle_driver); + 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; @@ -367,6 +370,7 @@ int __init omap3_idle_init(void) if (cpuidle_register_device(dev)) { printk(KERN_ERR "%s: CPUidle register device failed\n", __func__); + cpuidle_unregister_driver(&omap3_idle_driver); return -EIO; } |