diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2014-09-04 16:01:28 +0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-16 13:01:31 +0400 |
commit | 8468b029a2871b1f0e372a9354bddeac6b03af3b (patch) | |
tree | 274be012eb8e0645dae52bacc7a9e8ba778151d6 /drivers/power/power_supply_core.c | |
parent | a0f93b4268d903430d7e21110f10be0919daf3b2 (diff) | |
download | linux-8468b029a2871b1f0e372a9354bddeac6b03af3b.tar.xz |
power-supply: Rearrange code to remove duplicate lines
of_node_put() was called twice in power_supply_check_supplies() whereas a single
call will also work. Rearrange code a bit to make that feasible.
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 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index 7657335ea7f9..8a86cd138de8 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c @@ -218,12 +218,12 @@ static int power_supply_check_supplies(struct power_supply *psy) break; ret = power_supply_find_supply_from_node(np); + of_node_put(np); + if (ret) { dev_dbg(psy->dev, "Failed to find supply, defer!\n"); - of_node_put(np); return -EPROBE_DEFER; } - of_node_put(np); } while (np); /* Missing valid "power-supplies" entries */ |