All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Yong Shen <yong.shen@linaro.org>,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Arnaud Patard <arnaud.patard@rtp-net.org>,
	Liam Girdwood <lrg@ti.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH RFT 1/2] regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage
Date: Fri, 08 Jun 2012 15:39:34 +0800	[thread overview]
Message-ID: <1339141174.16616.2.camel@phoenix> (raw)

The voltage range checking should be to ensure mc13xxx_regulators[id].voltages[0]
falls with min_uV and max_uV.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/regulator/mc13xxx-regulator-core.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/regulator/mc13xxx-regulator-core.c b/drivers/regulator/mc13xxx-regulator-core.c
index 4fa9704..3e19171 100644
--- a/drivers/regulator/mc13xxx-regulator-core.c
+++ b/drivers/regulator/mc13xxx-regulator-core.c
@@ -158,8 +158,8 @@ int mc13xxx_fixed_regulator_set_voltage(struct regulator_dev *rdev, int min_uV,
 	dev_dbg(rdev_get_dev(rdev), "%s id: %d min_uV: %d max_uV: %d\n",
 		__func__, id, min_uV, max_uV);
 
-	if (min_uV >= mc13xxx_regulators[id].voltages[0] &&
-	    max_uV <= mc13xxx_regulators[id].voltages[0])
+	if (min_uV <= mc13xxx_regulators[id].voltages[0] &&
+	    mc13xxx_regulators[id].voltages[0] <= max_uV)
 		return 0;
 	else
 		return -EINVAL;
-- 
1.7.9.5




             reply	other threads:[~2012-06-08  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08  7:39 Axel Lin [this message]
2012-06-08  7:41 ` [PATCH RFT 2/2] regulator: mc13xxx: Convert to regulator_list_voltage_table Axel Lin
2012-06-17 20:01 ` [PATCH RFT 1/2] regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage Mark Brown

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=1339141174.16616.2.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=arnaud.patard@rtp-net.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=s.hauer@pengutronix.de \
    --cc=yong.shen@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.