diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-09-04 16:01:35 +0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-16 13:01:37 +0400 |
commit | 464069cae95f71ba670c7e3a90d919b18fb48d66 (patch) | |
tree | d7f57742c9af811a0bcc593697b7c9b026f37dd5 /drivers/power/power_supply_core.c | |
parent | 73b4a087ba4c0d0d52519769320fa684185c563e (diff) | |
download | linux-464069cae95f71ba670c7e3a90d919b18fb48d66.tar.xz |
power-supply: Avoid unnecessary 'goto' statements
Using 'goto' statements for freeing resources on failures is a good choice as it
makes code very clean, and reduces the chances of human errors.
Though in most cases compiler may take care of this. But adding unnecessary
'goto' statements wouldn't make anything better. Code becomes less readable
actually.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power/power_supply_core.c')
-rw-r--r-- | drivers/power/power_supply_core.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 376464e33fc8..81177e299230 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -599,7 +599,7 @@ static int __power_supply_register(struct device *parent, power_supply_changed(psy); - goto success; + return 0; create_triggers_failed: psy_unregister_cooler(psy); @@ -612,7 +612,6 @@ wakeup_init_failed: check_supplies_failed: dev_set_name_failed: put_device(dev); -success: return rc; } |