summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2026-04-07 14:33:38 +0200
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-06-03 21:58:54 +0200
commit68d234144b7dffd1f50b07ba74d0d6e833ef43a4 (patch)
tree975a4b3680bf7f8608d4226cc82ccb22bb4b0dd6
parent8eec545cde69e46e9a1d2b7d915ce4f5df85b3bd (diff)
downloadlinux-68d234144b7dffd1f50b07ba74d0d6e833ef43a4.tar.gz
linux-68d234144b7dffd1f50b07ba74d0d6e833ef43a4.zip
power: supply: max17042: fix OF node reference imbalance
The driver reuses the OF node of the parent multi-function device but fails to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices. Fix this by using the intended helper for reusing OF nodes. Fixes: 0cd4f1f77ad4 ("power: supply: max17042: add platform driver variant") Cc: stable@vger.kernel.org # 6.14 Cc: Dzmitry Sankouski <dsankouski@gmail.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://patch.msgid.link/20260407123338.2677375-1-johan@kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-rw-r--r--drivers/power/supply/max17042_battery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index abd276e13475..024fa38888f6 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -1288,7 +1288,8 @@ static int max17042_platform_probe(struct platform_device *pdev)
if (!i2c)
return -EINVAL;
- dev->of_node = dev->parent->of_node;
+ device_set_of_node_from_dev(dev, dev->parent);
+
id = platform_get_device_id(pdev);
irq = platform_get_irq(pdev, 0);