Skip to contentSkip to conversation

regulator: core: Handle probe deferral from DT when resolving supplies

PATCH In review Mark Brown 2 participants 2 messages Sep 30, 2015 – Oct 1, 2015 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

PATCH 1/1 regulator: core: Handle probe deferral from DT when resolving supplies

When resolving regulator-regulator supplies we ignore probe deferral returns from regulator_dev_lookup() (such as are generated for DT when we can see a supply is registered) and just fall back to the dummy regulator if there are full constraints (as is the case for DT). This means that probe deferral is broken for DT systems, fix that by paying attention to -EPROBE_DEFER return codes like we do -ENODEV.

A further patch will simplify this further, this is a minimal fix for the specific issue.

---

Tested with my famous "I need to leave the house right now so haven't even tried building this yet" test plan - please let me know how this works for you.

 drivers/regulator/core.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/regulator/core.c +4 -0
index af045e5..e9b94d7 100644
@@ -1448,6 +1448,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
 			return 0;
 		}
 
+		/* Did the lookup explicitly defer for us? */
+		if (ret == -EPROBE_DEFER)
+			return ret;
+
 		if (have_full_constraints()) {
 			r = dummy_regulator_rdev;
 			get_device(&r->dev);
Signature · 1 line
2.5.0
Tested-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mark Brown

When resolving regulator-regulator supplies we ignore probe deferral returns from regulator_dev_lookup() (such as are generated for DT when we can see a supply is registered) and just fall back to the dummy regulator if there are full constraints (as is the case for DT). This means that probe deferral is broken for DT systems, fix that by paying attention to -EPROBE_DEFER return codes like we do -ENODEV.

A further patch will simplify this further, this is a minimal fix for the specific issue.

Quoted 7 lines

---

Tested with my famous "I need to leave the house right now so haven't even tried building this yet" test plan - please let me know how this works for you.

Yes, this works as expected.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |