1
0
Fork 0

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>
hifive-unleashed-5.1
Viresh Kumar 2014-09-04 17:31:28 +05:30 committed by Sebastian Reichel
parent a0f93b4268
commit 8468b029a2
1 changed files with 2 additions and 2 deletions

View File

@ -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 */