lkml.org 
[lkml]   [2009]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] regulator: Don't warn on omitted voltage constraints
Date
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>
---
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 464e9b1..08441e2 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;
--
1.6.2


\
 
 \ /
  Last update: 2009-03-10 17:31    [W:0.041 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site