public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] regulator: more OF node reference fixes
@ 2026-04-07 12:20 Johan Hovold
  2026-04-07 12:20 ` [PATCH 1/3] regulator: max77650: fix OF node reference imbalance Johan Hovold
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-07 12:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	André Draszik, linux-kernel, Johan Hovold

Here's a second set of fixes for drivers that reuse OF nodes.

Johan


Johan Hovold (3):
  regulator: max77650: fix OF node reference imbalance
  regulator: mt6357: fix OF node reference imbalance
  regulator: s2dos05: fix OF node reference imbalance

 drivers/regulator/max77650-regulator.c | 2 +-
 drivers/regulator/mt6357-regulator.c   | 2 +-
 drivers/regulator/s2dos05-regulator.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

-- 
2.52.0


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

* [PATCH 1/3] regulator: max77650: fix OF node reference imbalance
  2026-04-07 12:20 [PATCH 0/3] regulator: more OF node reference fixes Johan Hovold
@ 2026-04-07 12:20 ` Johan Hovold
  2026-04-07 12:35   ` Bartosz Golaszewski
  2026-04-07 12:20 ` [PATCH 2/3] regulator: mt6357: " Johan Hovold
  2026-04-07 12:20 ` [PATCH 3/3] regulator: s2dos05: " Johan Hovold
  2 siblings, 1 reply; 5+ messages in thread
From: Johan Hovold @ 2026-04-07 12:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	André Draszik, linux-kernel, Johan Hovold, stable

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: bcc61f1c44fd ("regulator: max77650: add regulator support")
Cc: stable@vger.kernel.org	# 5.1
Cc: Bartosz Golaszewski <brgl@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/regulator/max77650-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c
index a809264c77fc..11b04a13f889 100644
--- a/drivers/regulator/max77650-regulator.c
+++ b/drivers/regulator/max77650-regulator.c
@@ -337,7 +337,7 @@ static int max77650_regulator_probe(struct platform_device *pdev)
 	parent = dev->parent;
 
 	if (!dev->of_node)
-		dev->of_node = parent->of_node;
+		device_set_of_node_from_dev(dev, parent);
 
 	rdescs = devm_kcalloc(dev, MAX77650_REGULATOR_NUM_REGULATORS,
 			      sizeof(*rdescs), GFP_KERNEL);
-- 
2.52.0


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

* [PATCH 2/3] regulator: mt6357: fix OF node reference imbalance
  2026-04-07 12:20 [PATCH 0/3] regulator: more OF node reference fixes Johan Hovold
  2026-04-07 12:20 ` [PATCH 1/3] regulator: max77650: fix OF node reference imbalance Johan Hovold
@ 2026-04-07 12:20 ` Johan Hovold
  2026-04-07 12:20 ` [PATCH 3/3] regulator: s2dos05: " Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-07 12:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	André Draszik, linux-kernel, Johan Hovold, stable

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: dafc7cde23dc ("regulator: add mt6357 regulator")
Cc: stable@vger.kernel.org	# 6.2
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/regulator/mt6357-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/mt6357-regulator.c b/drivers/regulator/mt6357-regulator.c
index 1eb69c7a6acb..09feb454ab6b 100644
--- a/drivers/regulator/mt6357-regulator.c
+++ b/drivers/regulator/mt6357-regulator.c
@@ -410,7 +410,7 @@ static int mt6357_regulator_probe(struct platform_device *pdev)
 	struct regulator_dev *rdev;
 	int i;
 
-	pdev->dev.of_node = pdev->dev.parent->of_node;
+	device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
 
 	for (i = 0; i < MT6357_MAX_REGULATOR; i++) {
 		config.dev = &pdev->dev;
-- 
2.52.0


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

* [PATCH 3/3] regulator: s2dos05: fix OF node reference imbalance
  2026-04-07 12:20 [PATCH 0/3] regulator: more OF node reference fixes Johan Hovold
  2026-04-07 12:20 ` [PATCH 1/3] regulator: max77650: fix OF node reference imbalance Johan Hovold
  2026-04-07 12:20 ` [PATCH 2/3] regulator: mt6357: " Johan Hovold
@ 2026-04-07 12:20 ` Johan Hovold
  2 siblings, 0 replies; 5+ messages in thread
From: Johan Hovold @ 2026-04-07 12:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	André Draszik, 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: bb2441402392 ("regulator: add s2dos05 regulator support")
Cc: stable@vger.kernel.org	# 6.18
Cc: Dzmitry Sankouski <dsankouski@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
 drivers/regulator/s2dos05-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/s2dos05-regulator.c b/drivers/regulator/s2dos05-regulator.c
index 1463585c4565..a1c394ddbaff 100644
--- a/drivers/regulator/s2dos05-regulator.c
+++ b/drivers/regulator/s2dos05-regulator.c
@@ -126,7 +126,7 @@ static int s2dos05_pmic_probe(struct platform_device *pdev)
 	s2dos05->regmap = iodev->regmap_pmic;
 	s2dos05->dev = dev;
 	if (!dev->of_node)
-		dev->of_node = dev->parent->of_node;
+		device_set_of_node_from_dev(dev, dev->parent);
 
 	config.dev = dev;
 	config.driver_data = s2dos05;
-- 
2.52.0


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

* Re: [PATCH 1/3] regulator: max77650: fix OF node reference imbalance
  2026-04-07 12:20 ` [PATCH 1/3] regulator: max77650: fix OF node reference imbalance Johan Hovold
@ 2026-04-07 12:35   ` Bartosz Golaszewski
  0 siblings, 0 replies; 5+ messages in thread
From: Bartosz Golaszewski @ 2026-04-07 12:35 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Liam Girdwood, Bartosz Golaszewski, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski,
	André Draszik, linux-kernel, stable, Mark Brown

On Tue, 7 Apr 2026 14:20:29 +0200, Johan Hovold <johan@kernel.org> said:
> 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: bcc61f1c44fd ("regulator: max77650: add regulator support")
> Cc: stable@vger.kernel.org	# 5.1
> Cc: Bartosz Golaszewski <brgl@kernel.org>
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
>  drivers/regulator/max77650-regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/regulator/max77650-regulator.c b/drivers/regulator/max77650-regulator.c
> index a809264c77fc..11b04a13f889 100644
> --- a/drivers/regulator/max77650-regulator.c
> +++ b/drivers/regulator/max77650-regulator.c
> @@ -337,7 +337,7 @@ static int max77650_regulator_probe(struct platform_device *pdev)
>  	parent = dev->parent;
>
>  	if (!dev->of_node)
> -		dev->of_node = parent->of_node;
> +		device_set_of_node_from_dev(dev, parent);
>
>  	rdescs = devm_kcalloc(dev, MAX77650_REGULATOR_NUM_REGULATORS,
>  			      sizeof(*rdescs), GFP_KERNEL);
> --
> 2.52.0
>
>

Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

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

end of thread, other threads:[~2026-04-07 12:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-07 12:20 [PATCH 0/3] regulator: more OF node reference fixes Johan Hovold
2026-04-07 12:20 ` [PATCH 1/3] regulator: max77650: fix OF node reference imbalance Johan Hovold
2026-04-07 12:35   ` Bartosz Golaszewski
2026-04-07 12:20 ` [PATCH 2/3] regulator: mt6357: " Johan Hovold
2026-04-07 12:20 ` [PATCH 3/3] regulator: s2dos05: " Johan Hovold

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