Linux Power Management development
 help / color / mirror / Atom feed
* [PATCH v2] power: supply: max17042: fix OF node reference imbalance
@ 2026-04-07 12:33 Johan Hovold
  2026-05-13  6:32 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Johan Hovold @ 2026-04-07 12:33 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Hans de Goede, Krzysztof Kozlowski, Marek Szyprowski,
	Sebastian Krzyszkowiak, Purism Kernel Team, linux-pm,
	linux-kernel, Johan Hovold, stable, Dzmitry Sankouski

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>
---

Changes in v2:
 - add missing driver name to patch summary prefix


 drivers/power/supply/max17042_battery.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/max17042_battery.c b/drivers/power/supply/max17042_battery.c
index acea176101fa..914f18ce79b3 100644
--- a/drivers/power/supply/max17042_battery.c
+++ b/drivers/power/supply/max17042_battery.c
@@ -1165,7 +1165,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);
 
-- 
2.52.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] power: supply: max17042: fix OF node reference imbalance
  2026-04-07 12:33 [PATCH v2] power: supply: max17042: fix OF node reference imbalance Johan Hovold
@ 2026-05-13  6:32 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2026-05-13  6:32 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Hans de Goede, Krzysztof Kozlowski, Marek Szyprowski,
	Sebastian Krzyszkowiak, Purism Kernel Team, linux-pm,
	linux-kernel, stable, Dzmitry Sankouski

Hi Sebastian,

On Tue, Apr 07, 2026 at 02:33:38PM +0200, Johan Hovold wrote:
> 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>
> ---
> 
> Changes in v2:
>  - add missing driver name to patch summary prefix

Can this one be picked up now?

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-13  6:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 12:33 [PATCH v2] power: supply: max17042: fix OF node reference imbalance Johan Hovold
2026-05-13  6:32 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox