regulator: fix OF node imbalance on reuse
Subsystems (6)
v2 cover regulator: fix OF node imbalance on reuse
These drivers reuse the OF node of their parent multi-function device but fail 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.
Note that the first two patches will cause a trivial conflict with Doug's series adding accessor functions for struct device flags which has now been merged to the driver-core tree:
https://lore.kernel.org/r/[email protected]
Johan
Changes in v2:
- use the correct rk808 Fixes tag
- merge all the fixes into one series
Johan Hovold (7):
regulator: bq257xx: fix OF node reference imbalance
regulator: rk808: fix OF node reference imbalance
regulator: max77650: fix OF node reference imbalance
regulator: mt6357: fix OF node reference imbalance
regulator: s2dos05: fix OF node reference imbalance
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 ++- drivers/regulator/bq257xx-regulator.c | 3 +-- drivers/regulator/max77650-regulator.c | 2 +- drivers/regulator/mt6357-regulator.c | 2 +- drivers/regulator/rk808-regulator.c | 3 +-- drivers/regulator/s2dos05-regulator.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-)
Signature · 1 line
2.52.0
PATCH v2 1/7 regulator: bq257xx: 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/bq257xx-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/regulator/bq257xx-regulator.c +1 -2
@@ -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)
Signature · 1 line
2.52.0
PATCH v2 2/7 regulator: rk808: 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/rk808-regulator.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/regulator/rk808-regulator.c +1 -2
@@ -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)
Signature · 1 line
2.52.0
PATCH v2 3/7 regulator: max77650: 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/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
PATCH v2 4/7 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 v2 5/7 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
PATCH v2 6/7 regulator: act8945a: 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/act8945a-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/act8945a-regulator.c +2 -1
@@ -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],
Signature · 1 line
2.52.0
PATCH v2 7/7 regulator: bd9571mwv: 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/bd9571mwv-regulator.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/regulator/bd9571mwv-regulator.c +2 -1
@@ -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
Mark Brown
maintainerQuoted 3 lines · Johan Hovold
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.
Quoted 6 lines · Mark Brown
Quoted 3 lines · Johan Hovold
Changes in v2:
- use the correct rk808 Fixes tag
- merge all the fixes into one series
Quoted 6 lines
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.
Sorry, was just trying to make it easier for you since I know you use feature branches when merging series (and these should all have been in one series from the start).
The patches themselves have identical summaries, even if the series names vary a bit.
Here are the three series this one supersedes:
https://lore.kernel.org/lkml/[email protected]/ https://lore.kernel.org/lkml/[email protected]/ https://lore.kernel.org/lkml/[email protected]/
Johan
Mark Brown
maintainerQuoted 8 lines · Johan Hovold
regulator: fix OF node imbalance on reuse
These drivers reuse the OF node of their parent multi-function device but fail to take another reference to balance the one dropped by the platform bus code when unbinding the MFD and deregistering the child devices.
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git for-7.1
Thanks!
[1/7] regulator: bq257xx: fix OF node reference imbalance
https://git.kernel.org/broonie/regulator/c/7ea07bc030d8 [2/7] regulator: rk808: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/65290b24d8a5 [3/7] regulator: max77650: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/2edaf5f7ada0 [4/7] regulator: mt6357: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/2f38e96c273e [5/7] regulator: s2dos05: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/ebe694d67f15 [6/7] regulator: act8945a: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/0d15ce31375c [7/7] regulator: bd9571mwv: fix OF node reference imbalance https://git.kernel.org/broonie/regulator/c/8498100ee1d0
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark