summaryrefslogtreecommitdiff
path: root/drivers/regulator/wm831x-isink.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-03-27 11:18:53 +0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-03-28 15:44:07 +0400
commited3be9a0e3c1050fe07d69a8c600d86cac76cdc4 (patch)
tree0c505e677af6570402c1a7ab067f571dba415c74 /drivers/regulator/wm831x-isink.c
parenta171e782a97d4ba55d7fa02f9a46904288b2c229 (diff)
downloadlinux-ed3be9a0e3c1050fe07d69a8c600d86cac76cdc4.tar.xz
regulator: wm831x-isink: Fix the logic to choose best current limit setting
Current code in wm831x_isink_set_current actually set the current limit setting smaller than specified range. Fix the logic in wm831x_isink_set_current to choose the smallest current limit setting falls within the specified range. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-isink.c')
-rw-r--r--drivers/regulator/wm831x-isink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index 634aac3f2d5f..b414e09c5620 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -101,7 +101,7 @@ static int wm831x_isink_set_current(struct regulator_dev *rdev,
for (i = 0; i < ARRAY_SIZE(wm831x_isinkv_values); i++) {
int val = wm831x_isinkv_values[i];
- if (min_uA >= val && val <= max_uA) {
+ if (min_uA <= val && val <= max_uA) {
ret = wm831x_set_bits(wm831x, isink->reg,
WM831X_CS1_ISEL_MASK, i);
return ret;