diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-03-10 16:28:36 +0000 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2009-03-31 09:56:26 +0100 |
commit | 3e2b9abda554e9f6105996dca77cca9ef98de17a (patch) | |
tree | 25f727d762a7afc42e2a2ea5761a6eb5ad33e205 /drivers/regulator | |
parent | 216765d92acaeabdad6561254a5a676325105a37 (diff) | |
download | linux-3e2b9abda554e9f6105996dca77cca9ef98de17a.tar.bz2 |
regulator: Don't warn on omitted voltage constraints
Specifying voltage constraints is optional (and only needed if the
consumer is allowed to change the voltage) so don't complain unless
a voltage has been specified.
Also avoid surprises with a dangling else while we're here.
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 | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index da357a07c98e..2ff76349f392 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -709,8 +709,12 @@ static int set_machine_constraints(struct regulator_dev *rdev, cmax = INT_MAX; } + /* voltage constraints are optional */ + if ((cmin == 0) && (cmax == 0)) + goto out; + /* else require explicit machine-level constraints */ - else if (cmin <= 0 || cmax <= 0 || cmax < cmin) { + if (cmin <= 0 || cmax <= 0 || cmax < cmin) { pr_err("%s: %s '%s' voltage constraints\n", __func__, "invalid", name); ret = -EINVAL; |