Commit 8468b029 authored by Viresh Kumar's avatar Viresh Kumar Committed by Sebastian Reichel

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: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent a0f93b42
...@@ -218,12 +218,12 @@ static int power_supply_check_supplies(struct power_supply *psy) ...@@ -218,12 +218,12 @@ static int power_supply_check_supplies(struct power_supply *psy)
break; break;
ret = power_supply_find_supply_from_node(np); ret = power_supply_find_supply_from_node(np);
of_node_put(np);
if (ret) { if (ret) {
dev_dbg(psy->dev, "Failed to find supply, defer!\n"); dev_dbg(psy->dev, "Failed to find supply, defer!\n");
of_node_put(np);
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
of_node_put(np);
} while (np); } while (np);
/* Missing valid "power-supplies" entries */ /* Missing valid "power-supplies" entries */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment