public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFT 1/2] regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage
@ 2012-06-08  7:39 Axel Lin
  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
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2012-06-08  7:39 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yong Shen, Fabio Estevam, Sascha Hauer, Arnaud Patard,
	Liam Girdwood, Mark Brown

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




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-17 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-08  7:39 [PATCH RFT 1/2] regulator: mc13xxx: Fix voltage checking for mc13xxx_fixed_regulator_set_voltage Axel Lin
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox