Skip to content
Commit 585b0087 authored by Viresh Kumar's avatar Viresh Kumar Committed by Sebastian Reichel
Browse files

power-supply: Don't return -EINVAL from __power_supply_find_supply_from_node()



We need to stop 'class_for_each_device' loop when a supply matches with the
of-node. In order to achieve this we currently return -EINVAL from
__power_supply_populate_supplied_from() on successful match.

class_for_each_device() is free to return similar errors in other cases as well
and so the choice of return value here isn't particularly great.

This commit isn't removing the Hack but making it more elegant by returning '1'
instead.

Also power_supply_find_supply_from_node() can return errors other than
-EPROBE_DEFER now if class_for_each_device() fails.

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
parent f5b89aff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment