From 585b008743b5a14d93e3d506729c73978edc8da7 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 4 Sep 2014 17:31:30 +0530 Subject: [PATCH] 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 Signed-off-by: Sebastian Reichel --- Reading git-format-patch failed