From 4aa922c024b2a194d7b68b22a66dfcf86e7838b3 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Sat, 14 May 2011 13:42:34 -0700 Subject: 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 Signed-off-by: Liam Girdwood --- drivers/regulator/core.c | 7 +++++++ 1 file changed, 7 insertions(+) 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, 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) -- cgit v1.2.3