aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/idle
diff options
context:
space:
mode:
authorRichard Cochran <rcochran@linutronix.de>2016-04-06 17:00:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-04-07 16:11:00 -0400
commitb69ef2c099c3e5f11bd5c33a9530d6522f72c9aa (patch)
treee540e242df7c442e7d7b6ccc92407eaa78b34d8b /drivers/idle
parent2259a819a8d37e472f08c88bc0dd22194754adb4 (diff)
intel_idle: Don't overreact to a cpuidle registration failure.
The helper function, intel_idle_cpu_init, registers one new device with the cpuidle layer. If the registration should fail, that function immediately calls intel_idle_cpuidle_devices_uninit() to unregister every last CPU's device. However, it makes no sense to do so, when called from the hot plug notifier callback. This patch moves the call to intel_idle_cpuidle_devices_uninit() outside of the helper function to the one call site that actually needs to perform the de-registrations. Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Len Brown <len.brown@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/idle')
-rw-r--r--drivers/idle/intel_idle.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index ab34cd8b933c..4418cfa2a4fc 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1175,7 +1175,6 @@ static int intel_idle_cpu_init(int cpu)
1175 1175
1176 if (cpuidle_register_device(dev)) { 1176 if (cpuidle_register_device(dev)) {
1177 pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu); 1177 pr_debug(PREFIX "cpuidle_register_device %d failed!\n", cpu);
1178 intel_idle_cpuidle_devices_uninit();
1179 return -EIO; 1178 return -EIO;
1180 } 1179 }
1181 1180
@@ -1219,6 +1218,7 @@ static int __init intel_idle_init(void)
1219 for_each_online_cpu(i) { 1218 for_each_online_cpu(i) {
1220 retval = intel_idle_cpu_init(i); 1219 retval = intel_idle_cpu_init(i);
1221 if (retval) { 1220 if (retval) {
1221 intel_idle_cpuidle_devices_uninit();
1222 cpu_notifier_register_done(); 1222 cpu_notifier_register_done();
1223 cpuidle_unregister_driver(&intel_idle_driver); 1223 cpuidle_unregister_driver(&intel_idle_driver);
1224 free_percpu(intel_idle_cpuidle_devices); 1224 free_percpu(intel_idle_cpuidle_devices);