diff mbox

[v2] regulator: core: Update regulator_is_supported_voltage for fixed voltages

Message ID 1352865266-25286-1-git-send-email-tushar.behera@linaro.org
State Superseded
Headers show

Commit Message

Tushar Behera Nov. 14, 2012, 3:54 a.m. UTC
Commit c5f3939b8fe0 ("regulator: core: Support fixed voltages in
regulator_is_supported_voltage()") returns success when the regulator
voltage is less than both min_uV and max_uV. Modify this to return
success only when the regulator voltage is within the specified range.

Signed-off-by: Tushar Behera <tushar.behera@linaro.org>
---
Changes since v1:
	* Return success when the regulator voltage is within the
	specified range.

 drivers/regulator/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Mark Brown Nov. 14, 2012, 4:12 a.m. UTC | #1
On Wed, Nov 14, 2012 at 09:24:26AM +0530, Tushar Behera wrote:
> Commit c5f3939b8fe0 ("regulator: core: Support fixed voltages in
> regulator_is_supported_voltage()") returns success when the regulator
> voltage is less than both min_uV and max_uV. Modify this to return
> success only when the regulator voltage is within the specified range.

I applied a version of this from Marek yesterday.
diff mbox

Patch

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 1a35251..e90e5c3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1974,7 +1974,7 @@  int regulator_is_supported_voltage(struct regulator *regulator,
 	if (!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_VOLTAGE)) {
 		ret = regulator_get_voltage(regulator);
 		if (ret >= 0)
-			return (min_uV >= ret && ret <= max_uV);
+			return (ret >= min_uV && ret <= max_uV);
 		else
 			return ret;
 	}