]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
regulator: Don't warn on omitted voltage constraints
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 10 Mar 2009 16:28:36 +0000 (16:28 +0000)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Tue, 31 Mar 2009 08:56:26 +0000 (09:56 +0100)
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>
drivers/regulator/core.c

index da357a07c98edbdee0f6e5ef689c589e0acfd716..2ff76349f392d364ced271af303004a602b8e0a3 100644 (file)
@@ -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;