regulator: Only apply voltage constraints from consumers that set them
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 14 May 2011 20:42:34 +0000 (13:42 -0700)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 27 May 2011 09:49:09 +0000 (10:49 +0100)
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>
drivers/regulator/core.c

index 7287000595e503b29880d64131dfee25b088dd3f..9493f6111a38d33b3cd8fc0542908b180416b05a 100644 (file)
@@ -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)