From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: linux-kernel@vger.kernel.org,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 2/2] regulator: Don't warn on omitted voltage constraints
Date: Tue, 10 Mar 2009 16:28:36 +0000 [thread overview]
Message-ID: <1236702516-30733-2-git-send-email-broonie@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1236702516-30733-1-git-send-email-broonie@opensource.wolfsonmicro.com>
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
next prev parent reply other threads:[~2009-03-10 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-10 16:28 [PATCH 1/2] regulator: Implement list_voltage() for WM8400 DCDCs and LDOs Mark Brown
2009-03-10 16:28 ` Mark Brown [this message]
2009-03-11 14:29 ` [PATCH 2/2] regulator: Don't warn on omitted voltage constraints Liam Girdwood
2009-03-11 14:29 ` [PATCH 1/2] regulator: Implement list_voltage() for WM8400 DCDCs and LDOs Liam Girdwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1236702516-30733-2-git-send-email-broonie@opensource.wolfsonmicro.com \
--to=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®