提交 3e2b9abd 编写于 作者: M Mark Brown 提交者: Liam Girdwood

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 216765d9
...@@ -709,8 +709,12 @@ static int set_machine_constraints(struct regulator_dev *rdev, ...@@ -709,8 +709,12 @@ static int set_machine_constraints(struct regulator_dev *rdev,
cmax = INT_MAX; cmax = INT_MAX;
} }
/* voltage constraints are optional */
if ((cmin == 0) && (cmax == 0))
goto out;
/* else require explicit machine-level constraints */ /* 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", pr_err("%s: %s '%s' voltage constraints\n",
__func__, "invalid", name); __func__, "invalid", name);
ret = -EINVAL; ret = -EINVAL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册