aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/cpuidle.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-10-03 11:56:46 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-10-29 20:21:22 -0400
commit47182668ca140ae067d5961ec8c59edf646b36c7 (patch)
tree1890c804601f6eb8dad535120011bab430ad475e /drivers/cpuidle/cpuidle.c
parentb171a85648e7055c6680c259a9a87806a56a24c3 (diff)
cpuidle: rearrange __cpuidle_register_device() to keep minimal exit points
This patch rearranges __cpuidle_register_device() a bit in order to reduce the number of exit points in that function. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r--drivers/cpuidle/cpuidle.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 211e504263fa..8c91badff00b 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -383,13 +383,12 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
383 list_add(&dev->device_list, &cpuidle_detected_devices); 383 list_add(&dev->device_list, &cpuidle_detected_devices);
384 384
385 ret = cpuidle_coupled_register_device(dev); 385 ret = cpuidle_coupled_register_device(dev);
386 if (ret) { 386 if (ret)
387 __cpuidle_unregister_device(dev); 387 __cpuidle_unregister_device(dev);
388 return ret; 388 else
389 } 389 dev->registered = 1;
390 390
391 dev->registered = 1; 391 return ret;
392 return 0;
393} 392}
394 393
395/** 394/**