Skip to contentSkip to conversation

regulator: Only apply voltage constraints from consumers that set them

PATCH Applied Mark Brown 2 participants 2 messages May 14, 2011 – May 16, 2011 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 regulator: Only apply voltage constraints from consumers that set them

When applying the set_voltage() requests from consumers skip over those consumers that haven't set anything, otherwise we'll come out with a maximum voltage of zero.

---
 drivers/regulator/core.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
drivers/regulator/core.c +7 -0
index 051a45d..60ae920 100644
@@ -161,6 +161,13 @@ static int regulator_check_consumers(struct regulator_dev *rdev,
 	struct regulator *regulator;
 
 	list_for_each_entry(regulator, &rdev->consumer_list, list) {
+		/*
+		 * Assume consumers that didn't say anything are OK
+		 * with anything in the constraint range.
+		 */
+		if (!regulator->min_uV && !regulator->max_uV)
+			continue;
+
 		if (*max_uV > regulator->max_uV)
 			*max_uV = regulator->max_uV;
 		if (*min_uV < regulator->min_uV)
Signature · 1 line
1.7.5.1
#1 lore raw
Quoted 6 lines · Mark Brown

When applying the set_voltage() requests from consumers skip over those consumers that haven't set anything, otherwise we'll come out with a maximum voltage of zero.

---

Applied.

Thanks

Liam