Commit dea1a925 authored by Badhri Jagan Sridharan's avatar Badhri Jagan Sridharan Committed by Alistair Delva
Browse files

ANDROID: power_supply: Add a helper function to retrieve psy array from phandle

power_supply_get_by_phandle retrieves power_supply object based on
phandle. However, when multiple power_supply objects are registered
by the same parent device the first power_supply object's reference
is returned. This returned power_supply object's reference varies
according to probe order. Add a helper to return all the power_supply
object's reference.

The caller has to provide the power_supply pointer array.
-EOVERFLOW is returned when the size of the array is not enough to
pass back all the power_supply objects.

Patch was sent to mainline linux, however, was deemed incomplete due
to lack of mainline user.

Link: https://lore.kernel.org/linux-pm/20200407211243.247362-1-badhri@google.com/T/


Bug: 161416774
Bug: 167486462
Signed-off-by: default avatarBadhri Jagan Sridharan <badhri@google.com>
Change-Id: I6d9c52edb4472e73fc2d3c8eb32a41bec8bbde2a
parent 2bd29a10
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment