Skip to contentSkip to conversation

regulator: even more OF node imbalance fixes

PATCH Superseded Johan Hovold 2 participants 6 messages Apr 7

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover regulator: even more OF node imbalance fixes

I missed these drivers which probably meant to set config->of_node in my previous rounds.

Johan

Johan Hovold (2):
regulator: act8945a: fix OF node reference imbalance
regulator: bd9571mwv: fix OF node reference imbalance

 drivers/regulator/act8945a-regulator.c  | 3 ++-
 drivers/regulator/bd9571mwv-regulator.c | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH 1/2 regulator: act8945a: 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 38c09961048b ("regulator: act8945a: add regulator driver for ACT8945A")
Cc Wenyou Yang <[email protected]>
---
 drivers/regulator/act8945a-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/act8945a-regulator.c +2 -1
index 24cbdd833863..5bbe2bce740e 100644
@@ -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, &regulators[i],
Signature · 1 line
2.52.0
#2 lore raw

PATCH 2/2 regulator: bd9571mwv: fix OF node reference imbalance

In reply to Johan Hovold

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 Marek Vasut <[email protected]>
---
 drivers/regulator/bd9571mwv-regulator.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/bd9571mwv-regulator.c +2 -1
index 209beabb5c37..f4de24a281b1 100644
@@ -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;
 
Signature · 1 line
2.52.0
maintainer
#3 lore raw
In reply to Johan Hovold
Quoted 2 lines · Johan Hovold

I missed these drivers which probably meant to set config->of_node in my previous rounds.

It would be somewhat easier to just send individual patches for all these things, there's no real interrelationship between the patches other than the similarity of the issus.

#4 lore raw
Quoted 8 lines · Mark Brown
Quoted 2 lines · Johan Hovold

I missed these drivers which probably meant to set config->of_node in my previous rounds.

It would be somewhat easier to just send individual patches for all these things, there's no real interrelationship between the patches other than the similarity of the issus.

Possibly in this case, but not if there is any feedback that applies to all patches in the series.

I assume you don't want me to resend these now, though?

Johan

maintainer
#5 lore raw
Quoted 8 lines · Johan Hovold
Quoted 3 lines · Mark Brown

It would be somewhat easier to just send individual patches for all these things, there's no real interrelationship between the patches other than the similarity of the issus.

Possibly in this case, but not if there is any feedback that applies to all patches in the series.

Once you're sending multiple similiar followup serieses that

Quoted 1 line

I assume you don't want me to resend these now, though?

Right, please don't.