diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-05-14 16:42:34 -0400 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-05-27 05:49:09 -0400 |
commit | 4aa922c024b2a194d7b68b22a66dfcf86e7838b3 (patch) | |
tree | 1a26ab1f3fcb48f02642c246a29e5c9ef9492665 /drivers/regulator | |
parent | a4b4148379ef1ad460fc1aa6bcf2cde99cd91166 (diff) |
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.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 7287000595e5..9493f6111a38 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -158,6 +158,13 @@ static int regulator_check_consumers(struct regulator_dev *rdev, | |||
158 | struct regulator *regulator; | 158 | struct regulator *regulator; |
159 | 159 | ||
160 | list_for_each_entry(regulator, &rdev->consumer_list, list) { | 160 | list_for_each_entry(regulator, &rdev->consumer_list, list) { |
161 | /* | ||
162 | * Assume consumers that didn't say anything are OK | ||
163 | * with anything in the constraint range. | ||
164 | */ | ||
165 | if (!regulator->min_uV && !regulator->max_uV) | ||
166 | continue; | ||
167 | |||
161 | if (*max_uV > regulator->max_uV) | 168 | if (*max_uV > regulator->max_uV) |
162 | *max_uV = regulator->max_uV; | 169 | *max_uV = regulator->max_uV; |
163 | if (*min_uV < regulator->min_uV) | 170 | if (*min_uV < regulator->min_uV) |