mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Fix resolve supply
@ 2024-11-13 15:36 Kory Maincent
  2024-11-13 16:05 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Kory Maincent @ 2024-11-13 15:36 UTC (permalink / raw)
  To: Bjorn Andersson, Mark Brown, linux-kernel
  Cc: Kory Maincent, thomas.petazzoni, Liam Girdwood

The regulator should not use the device parent to resolve the regulator
supply. It fails to resolve the correct supply when the of_node
variable in the regulator_config structure is not within the parent
node.

Fixes: 6261b06de565 ("regulator: Defer lookup of supply to regulator_get")
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
---

It is weird that it wasn't seen before, maybe there was not any case
were it can't find the supply_name from the parent device.
---
 drivers/regulator/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 76d3cd5ae6ea..ee5bc070b5bb 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2023,7 +2023,7 @@ static struct regulator_dev *regulator_dev_lookup(struct device *dev,
 static int regulator_resolve_supply(struct regulator_dev *rdev)
 {
 	struct regulator_dev *r;
-	struct device *dev = rdev->dev.parent;
+	struct device *dev = &rdev->dev;
 	struct ww_acquire_ctx ww_ctx;
 	int ret = 0;
 
-- 
2.34.1


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

end of thread, other threads:[~2024-11-14 17:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-13 15:36 [PATCH] regulator: core: Fix resolve supply Kory Maincent
2024-11-13 16:05 ` Mark Brown
2024-11-13 16:36   ` Kory Maincent
2024-11-14 13:27     ` Mark Brown
2024-11-14 14:36       ` Kory Maincent
2024-11-14 17:24         ` Mark Brown

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

all inboxes | Powered by JetHome®