aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-02 13:54:17 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-07-02 13:26:04 -0400
commit1a5d39d0644fa01e659ee42b5ec47abbd7db3afb (patch)
treeb22189d061a6178db4030259f149e479dd02652e /drivers/regulator
parent1e12dfc9681fed46fbc9fffc6aba9613908c1213 (diff)
regulator: tps65217: invalid if check
This permits the setting of bogus values because the invalidity check is itself invalid. Reported-by: dcb314@hotmail.com Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/tps65217-regulator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/regulator/tps65217-regulator.c b/drivers/regulator/tps65217-regulator.c
index 3a2b839276fe..0a3df5b7c904 100644
--- a/drivers/regulator/tps65217-regulator.c
+++ b/drivers/regulator/tps65217-regulator.c
@@ -78,7 +78,7 @@ static int tps65217_vsel_to_uv1(unsigned int vsel)
78 78
79static int tps65217_uv_to_vsel1(int uV, unsigned int *vsel) 79static int tps65217_uv_to_vsel1(int uV, unsigned int *vsel)
80{ 80{
81 if ((uV < 0) && (uV > 3300000)) 81 if (uV < 0 || uV > 3300000)
82 return -EINVAL; 82 return -EINVAL;
83 83
84 if (uV <= 1500000) 84 if (uV <= 1500000)
@@ -112,7 +112,7 @@ static int tps65217_vsel_to_uv2(unsigned int vsel)
112 112
113static int tps65217_uv_to_vsel2(int uV, unsigned int *vsel) 113static int tps65217_uv_to_vsel2(int uV, unsigned int *vsel)
114{ 114{
115 if ((uV < 0) && (uV > 3300000)) 115 if (uV < 0 || uV > 3300000)
116 return -EINVAL; 116 return -EINVAL;
117 117
118 if (uV <= 1900000) 118 if (uV <= 1900000)