summaryrefslogtreecommitdiff
path: root/drivers/power/supply/charger-manager.c
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2017-04-16 17:30:31 +0200
committerSebastian Reichel <sre@kernel.org>2017-05-01 11:51:20 +0200
commit2848e039c562a5278cd2ebc5b005c0f1a381b34e (patch)
tree757b3d88a4b55704ab13abb1090873342205ba14 /drivers/power/supply/charger-manager.c
parent19a2ee69c20255157738402b6fdbcf5d708dad80 (diff)
power: supply: Make power_supply_am_i_supplied return -ENODEV if there are no suppliers
It is sensible to assume that the hardware actually always has a way of charging the battery so when power_supply_am_i_supplied does not find any suppliers, that does not mean that there are none, but simply that no power_supply-drivers are registered / bound for any suppliers for the supply calling power_supply_am_i_supplied. At which point a fuel-gauge driver calling power_supply_am_i_supplied() cannot determine whether the battery is being charged or not. Allow a caller of power_supply_am_i_supplied to differentiate between there not being any suppliers, vs no suppliers being online by returning -ENODEV if there are no suppliers matching supplied_to / supplied_from, which allows fuel-gauge drivers to return POWER_SUPPLY_STATUS_UNKNOWN rather then POWER_SUPPLY_STATUS_DISCHARGING if there are no suppliers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'drivers/power/supply/charger-manager.c')
0 files changed, 0 insertions, 0 deletions