* [PATCH v2 1/7] regulator: bq257xx: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 2/7] regulator: rk808: " Johan Hovold
` (6 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel, Johan Hovold,
stable, Chris Morgan
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: 981dd162b635 ("regulator: bq257xx: Add bq257xx boost regulator driver")
Cc: stable@vger.kernel.org # 6.18
Cc: Chris Morgan <macromorgan@hotmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/regulator/bq257xx-regulator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/regulator/bq257xx-regulator.c b/drivers/regulator/bq257xx-regulator.c
index dab8f1ab4450..711dbe045383 100644
--- a/drivers/regulator/bq257xx-regulator.c
+++ b/drivers/regulator/bq257xx-regulator.c
@@ -142,8 +142,7 @@ static int bq257xx_regulator_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
struct regulator_config cfg = {};
- pdev->dev.of_node = pdev->dev.parent->of_node;
- pdev->dev.of_node_reused = true;
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
pdata = devm_kzalloc(&pdev->dev, sizeof(struct bq257xx_reg_data), GFP_KERNEL);
if (!pdata)
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 2/7] regulator: rk808: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
2026-04-08 7:30 ` [PATCH v2 1/7] regulator: bq257xx: fix OF node reference imbalance Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 3/7] regulator: max77650: " Johan Hovold
` (5 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel, Johan Hovold,
stable, Sebastian Reichel
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: 647e57351f8e ("regulator: rk808: reduce 'struct rk808' usage")
Cc: stable@vger.kernel.org # 6.2
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/regulator/rk808-regulator.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/regulator/rk808-regulator.c b/drivers/regulator/rk808-regulator.c
index e66408f23bb6..1e956153427e 100644
--- a/drivers/regulator/rk808-regulator.c
+++ b/drivers/regulator/rk808-regulator.c
@@ -2114,8 +2114,7 @@ static int rk808_regulator_probe(struct platform_device *pdev)
struct regmap *regmap;
int ret, i, nregulators;
- pdev->dev.of_node = pdev->dev.parent->of_node;
- pdev->dev.of_node_reused = true;
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!regmap)
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 3/7] regulator: max77650: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
2026-04-08 7:30 ` [PATCH v2 1/7] regulator: bq257xx: fix OF node reference imbalance Johan Hovold
2026-04-08 7:30 ` [PATCH v2 2/7] regulator: rk808: " Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 4/7] regulator: mt6357: " Johan Hovold
` (4 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel, Johan Hovold,
stable, Bartosz Golaszewski
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
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
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] 9+ messages in thread* [PATCH v2 4/7] regulator: mt6357: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
` (2 preceding siblings ...)
2026-04-08 7:30 ` [PATCH v2 3/7] regulator: max77650: " Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 5/7] regulator: s2dos05: " Johan Hovold
` (3 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, 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] 9+ messages in thread* [PATCH v2 5/7] regulator: s2dos05: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
` (3 preceding siblings ...)
2026-04-08 7:30 ` [PATCH v2 4/7] regulator: mt6357: " Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 6/7] regulator: act8945a: " Johan Hovold
` (2 subsequent siblings)
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, 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] 9+ messages in thread* [PATCH v2 6/7] regulator: act8945a: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
` (4 preceding siblings ...)
2026-04-08 7:30 ` [PATCH v2 5/7] regulator: s2dos05: " Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 7:30 ` [PATCH v2 7/7] regulator: bd9571mwv: " Johan Hovold
2026-04-08 16:56 ` [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Mark Brown
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel, Johan Hovold,
stable, Wenyou Yang
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: 38c09961048b ("regulator: act8945a: add regulator driver for ACT8945A")
Cc: stable@vger.kernel.org # 4.6
Cc: Wenyou Yang <wenyou.yang@atmel.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/regulator/act8945a-regulator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/act8945a-regulator.c b/drivers/regulator/act8945a-regulator.c
index 24cbdd833863..5bbe2bce740e 100644
--- a/drivers/regulator/act8945a-regulator.c
+++ b/drivers/regulator/act8945a-regulator.c
@@ -302,8 +302,9 @@ static int act8945a_pmic_probe(struct platform_device *pdev)
num_regulators = ARRAY_SIZE(act8945a_regulators);
}
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
+
config.dev = &pdev->dev;
- config.dev->of_node = pdev->dev.parent->of_node;
config.driver_data = act8945a;
for (i = 0; i < num_regulators; i++) {
rdev = devm_regulator_register(&pdev->dev, ®ulators[i],
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 7/7] regulator: bd9571mwv: fix OF node reference imbalance
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
` (5 preceding siblings ...)
2026-04-08 7:30 ` [PATCH v2 6/7] regulator: act8945a: " Johan Hovold
@ 2026-04-08 7:30 ` Johan Hovold
2026-04-08 16:56 ` [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Mark Brown
7 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2026-04-08 7:30 UTC (permalink / raw)
To: Mark Brown
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel, Johan Hovold,
stable, Marek Vasut
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: e85c5a153fe2 ("regulator: Add ROHM BD9571MWV-M PMIC regulator driver")
Cc: stable@vger.kernel.org # 4.12
Cc: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/regulator/bd9571mwv-regulator.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/regulator/bd9571mwv-regulator.c b/drivers/regulator/bd9571mwv-regulator.c
index 209beabb5c37..f4de24a281b1 100644
--- a/drivers/regulator/bd9571mwv-regulator.c
+++ b/drivers/regulator/bd9571mwv-regulator.c
@@ -287,8 +287,9 @@ static int bd9571mwv_regulator_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, bdreg);
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
+
config.dev = &pdev->dev;
- config.dev->of_node = pdev->dev.parent->of_node;
config.driver_data = bdreg;
config.regmap = bdreg->regmap;
--
2.52.0
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 0/7] regulator: fix OF node imbalance on reuse
2026-04-08 7:30 [PATCH v2 0/7] regulator: fix OF node imbalance on reuse Johan Hovold
` (6 preceding siblings ...)
2026-04-08 7:30 ` [PATCH v2 7/7] regulator: bd9571mwv: " Johan Hovold
@ 2026-04-08 16:56 ` Mark Brown
7 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-04-08 16:56 UTC (permalink / raw)
To: Johan Hovold
Cc: Liam Girdwood, Marek Vasut, Bartosz Golaszewski, Matthias Brugger,
AngeloGioacchino Del Regno, Krzysztof Kozlowski,
André Draszik, Douglas Anderson, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
On Wed, Apr 08, 2026 at 09:30:48AM +0200, Johan Hovold wrote:
> Changes in v2:
> - use the correct rk808 Fixes tag
> - merge all the fixes into one series
Please don't do stuff like this, it just makes it more annoying to track
what's going on, especially given that you have other similar patches
not included in this in flight, you sent some of these less than 24
hours ago and the ones this replaces aren't named consistently
("reference" vs "imbalance"). Either leave things a bit longer or stick
with the serieses you have.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread