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:Badhri Jagan Sridharan <badhri@google.com> Change-Id: I6d9c52edb4472e73fc2d3c8eb32a41bec8bbde2a
Loading