regulator: more OF node reference fixes
Subsystems (5)
cover regulator: more OF node reference fixes
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(-)
Signature · 1 line
2.52.0
PATCH 1/3 regulator: max77650: 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.
--- drivers/regulator/max77650-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/max77650-regulator.c +1 -1
@@ -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 );
Signature · 1 line
2.52.0
Re: [PATCH 1/3] regulator: max77650: fix OF node reference imbalance
Quoted 29 lines · 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 bcc61f1c44fd ("regulator: max77650: add regulator support")Cc [email protected] # 5.1Cc Bartosz Golaszewski <[email protected]>Signed-off-by Johan Hovold <[email protected]>--- drivers/regulator/max77650-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/max77650-regulator.c +1
-2@@ -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 ); --
Quoted 3 lines
2.52.0
PATCH 2/3 regulator: mt6357: fix OF node reference imbalance
In reply to Johan HovoldThe 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.
--- drivers/regulator/mt6357-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/mt6357-regulator.c +1 -1
@@ -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;
Signature · 1 line
2.52.0
PATCH 3/3 regulator: s2dos05: fix OF node reference imbalance
In reply to Johan HovoldThe 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.
--- drivers/regulator/s2dos05-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/s2dos05-regulator.c +1 -1
@@ -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;
Signature · 1 line
2.52.0