Commit a0f93b42 authored by Viresh Kumar's avatar Viresh Kumar Committed by Sebastian Reichel

power-supply: Use 'break' instead of 'continue' to end loop

In few routines, we need to end the do-while loop when no more "power-supplies"
are available. Currently we are doing 'continue' which will make the
'while(np)' conditional statement run again.

Skip this by doing a 'break' instead.
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent e80cf421
...@@ -127,7 +127,7 @@ static int __power_supply_populate_supplied_from(struct device *dev, ...@@ -127,7 +127,7 @@ static int __power_supply_populate_supplied_from(struct device *dev,
do { do {
np = of_parse_phandle(psy->of_node, "power-supplies", i++); np = of_parse_phandle(psy->of_node, "power-supplies", i++);
if (!np) if (!np)
continue; break;
if (np == epsy->of_node) { if (np == epsy->of_node) {
dev_info(psy->dev, "%s: Found supply : %s\n", dev_info(psy->dev, "%s: Found supply : %s\n",
...@@ -215,7 +215,7 @@ static int power_supply_check_supplies(struct power_supply *psy) ...@@ -215,7 +215,7 @@ static int power_supply_check_supplies(struct power_supply *psy)
np = of_parse_phandle(psy->of_node, "power-supplies", cnt++); np = of_parse_phandle(psy->of_node, "power-supplies", cnt++);
if (!np) if (!np)
continue; break;
ret = power_supply_find_supply_from_node(np); ret = power_supply_find_supply_from_node(np);
if (ret) { if (ret) {
......
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