[PATCH 5.15 094/164] power: supply: ab8500_bmdata: Use standard phandle

Sasha Levin
2026-02-28T18:16:25Z

From: Linus Walleij <linus.walleij@linaro.org>

[ Upstream commit 1a6784359540dcfbf4fa73c07868b80c8405cc14 ]

Look up the battery using the "monitored-battery" phandle
as is nowadays a standard DT binding. The actual bindings
for these charger elements are not upstream so let's sort
out this mess by conforming to the standard.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Stable-dep-of: c4af8a98bb52 ("power: supply: ab8500: Fix use-after-free in power_supply_changed()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/supply/ab8500_bmdata.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/power/supply/ab8500_bmdata.c b/drivers/power/supply/ab8500_bmdata.c
index 6f5fb794042ce..bfc1245d79123 100644
--- a/drivers/power/supply/ab8500_bmdata.c
+++ b/drivers/power/supply/ab8500_bmdata.c
@@ -497,8 +497,7 @@ int ab8500_bm_of_probe(struct device *dev,
const char *btech;
int i;

- /* get phandle to 'battery-info' node */
- battery_node = of_parse_phandle(np, "battery", 0);
+ battery_node = of_parse_phandle(np, "monitored-battery", 0);
if (!battery_node) {
dev_err(dev, "battery node or reference missing\n");
return -EINVAL;
--
2.51.0