Skip to content

Commit

Permalink
regulator: Only apply voltage constraints from consumers that set them
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown authored and Liam Girdwood committed May 27, 2011
1 parent a4b4148 commit 4aa922c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,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)
Expand Down

0 comments on commit 4aa922c

Please sign in to comment.