aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-03-10 12:28:36 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2009-03-31 04:56:26 -0400
commit3e2b9abda554e9f6105996dca77cca9ef98de17a (patch)
tree25f727d762a7afc42e2a2ea5761a6eb5ad33e205 /drivers/regulator
parent216765d92acaeabdad6561254a5a676325105a37 (diff)
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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index da357a07c98..2ff76349f39 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -709,8 +709,12 @@ static int set_machine_constraints(struct regulator_dev *rdev,
709 cmax = INT_MAX; 709 cmax = INT_MAX;
710 } 710 }
711 711
712 /* voltage constraints are optional */
713 if ((cmin == 0) && (cmax == 0))
714 goto out;
715
712 /* else require explicit machine-level constraints */ 716 /* else require explicit machine-level constraints */
713 else if (cmin <= 0 || cmax <= 0 || cmax < cmin) { 717 if (cmin <= 0 || cmax <= 0 || cmax < cmin) {
714 pr_err("%s: %s '%s' voltage constraints\n", 718 pr_err("%s: %s '%s' voltage constraints\n",
715 __func__, "invalid", name); 719 __func__, "invalid", name);
716 ret = -EINVAL; 720 ret = -EINVAL;