ANDROID: power_supply: Use fwnode to retrieve psy array from phandle
Upstream commit f368f87b ("power: supply: core: convert to fwnnode") replaced all instances of device nodes in power supply with fwnodes. Update the helper introduced by commit dea1a925 ("ANDROID: power_supply: Add a helper function to retrieve psy array from phandle") to be more in-line with upstream and remove its empty definition because it no longer needs to be guarded by CONFIG_OF. We maintain this helper as an out-of-tree patch because it was rejected upstream for not having a mainline user. Signal to vendors that this implementation has changed by renaming this function from "power_supply_get_by_phandle_array" to "power_supply_get_by_reference_array", using the naming convention from commit 370643f4 ("power: supply: core: rename power_supply_get_by_phandle power_supply_get_by_reference"). This change fixes the following kernelci build issue caused by removing the if CONFIG_OF guards around the original helper function: drivers/power/supply/power_supply_core.c:590:5: error: conflicting types for ‘power_supply_get_by_phandle_array’; have ‘int(struct device_node *, const char *, struct power_supply **, ssize_t)’ {aka ‘int(struct device_node *, const char *, struct power_supply **, long int)’} 590 | int power_supply_get_by_phandle_array(struct device_node *np, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/power/supply/power_supply_core.c:21: ./include/linux/power_supply.h:823:1: note: previous definition of ‘power_supply_get_by_phandle_array’ with type ‘int(struct device_node *, const char *, struct power_supply **, int)’ 823 | power_supply_get_by_phandle_array(struct device_node *np, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Fixes: dea1a925 ("ANDROID: power_supply: Add a helper function to retrieve psy array from phandle") Fixes: f368f87b ("power: supply: core: convert to fwnnode") Change-Id: I320dbdfc0d631649087c070489c73fb43ac102d7 Signed-off-by:Tiffany Yang <ynaffit@google.com>
Loading
Please sign in to comment