power-supply: Don't return -EINVAL from __power_supply_find_supply_from_node()
authorViresh Kumar <viresh.kumar@linaro.org>
Thu, 4 Sep 2014 12:01:30 +0000 (17:31 +0530)
committerSebastian Reichel <sre@kernel.org>
Tue, 16 Sep 2014 09:01:33 +0000 (11:01 +0200)
commit585b008743b5a14d93e3d506729c73978edc8da7
treef9aebdaa291df8651f5733ad553039c338b36e40
parentf5b89affe2b2e6a6092f4228baf08a6dd59bfc61
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: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/power_supply_core.c
This page took 0.034563 seconds and 5 git commands to generate.