mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: as3722: use the platform OF node setter
@ 2026-11-04 18:09 Yige Jiang
  2026-11-05  9:00 ` Bartosz Golaszewski
  0 siblings, 1 reply; 5+ messages in thread
From: Yige Jiang @ 2026-11-04 18:09 UTC (permalink / raw)
  To: Mark Brown
  Cc: Yige Jiang, Liam Girdwood, linux-kernel, Bartosz Golaszewski,
	WenTao Liang

as3722_get_regulator_dt_data() gets the regulators child node and
assigns it only to dev.of_node. Platform device release now puts
dev.fwnode, leaving the acquired node reference unreleased.

Use platform_device_set_of_node() to synchronize both fields and
give the device its own reference, then put the local lookup
reference. This keeps the node valid for regulator matching and
the platform device lifetime, while also replacing the previous
device-owned reference on a probe retry.

Fixes: 7b5b51b2b05c ("driver core: platform: count references to all kinds of firmware nodes")
Assisted-by: LLM
Signed-off-by: Yige Jiang <yigejiang86@gmail.com>
---
Based on linux-next next-20261102 (2637bdec0535).
Compile-tested: arm64, GCC 14.2.0, W=1, CONFIG_OF_DYNAMIC=y.
COMPILE_TEST=y.
Baseline and patched target objects built from this exact base.
No full kernel/module-link, hardware or runtime test was performed.
AI assistance: Codex (LLM) for ownership analysis, code and changelog.

The earlier dangling-node fix is already present in this base.

 drivers/regulator/as3722-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/as3722-regulator.c b/drivers/regulator/as3722-regulator.c
index 85e2aaa1a06b..9bf28e4b9821 100644
--- a/drivers/regulator/as3722-regulator.c
+++ b/drivers/regulator/as3722-regulator.c
@@ -596,7 +596,8 @@ static int as3722_get_regulator_dt_data(struct platform_device *pdev,
 		dev_err(&pdev->dev, "Device is not having regulators node\n");
 		return -ENODEV;
 	}
-	pdev->dev.of_node = np;
+	platform_device_set_of_node(pdev, np);
+	of_node_put(np);
 
 	ret = of_regulator_match(&pdev->dev, np, as3722_regulator_matches,
 			ARRAY_SIZE(as3722_regulator_matches));

base-commit: 2637bdec0535a2044cd830eba9a79363651d9043

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

end of thread, other threads:[~2026-11-05 14:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04 18:09 [PATCH] regulator: as3722: use the platform OF node setter Yige Jiang
2026-11-05  9:00 ` Bartosz Golaszewski
2026-11-05 10:03   ` [PATCH v2] " Yige Jiang
2026-11-05 11:20     ` Mark Brown
2026-11-05 14:04     ` Bartosz Golaszewski

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

all inboxes | Powered by JetHome®