aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/s5m8767.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-10 04:52:59 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-10 04:52:59 -0400
commitb920eb41a8241c54efbbd4f2ed6d074f497b0d9e (patch)
tree5941091817e932add192f8e58dc88d483322e214 /drivers/regulator/s5m8767.c
parenta9d5801041eecc7baceff49a28e82f91f207a961 (diff)
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
Merge tag 'v3.4-rc2' into regulator-drivers
Linux 3.4-rc2 contains some fixes that further patches depend upon.
Diffstat (limited to 'drivers/regulator/s5m8767.c')
-rw-r--r--drivers/regulator/s5m8767.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 10c38f9ae787..c4a584c268ce 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -361,8 +361,7 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
361 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev); 361 struct s5m8767_info *s5m8767 = rdev_get_drvdata(rdev);
362 const struct s5m_voltage_desc *desc; 362 const struct s5m_voltage_desc *desc;
363 int reg_id = rdev_get_id(rdev); 363 int reg_id = rdev_get_id(rdev);
364 int reg, mask, ret; 364 int sel, reg, mask, ret;
365 int i;
366 u8 val; 365 u8 val;
367 366
368 switch (reg_id) { 367 switch (reg_id) {
@@ -383,19 +382,20 @@ static int s5m8767_set_voltage(struct regulator_dev *rdev,
383 382
384 desc = reg_voltage_map[reg_id]; 383 desc = reg_voltage_map[reg_id];
385 384
386 i = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV); 385 sel = s5m8767_convert_voltage_to_sel(desc, min_uV, max_uV);
387 if (i < 0) 386 if (sel < 0)
388 return i; 387 return sel;
389 388
390 ret = s5m8767_get_voltage_register(rdev, &reg); 389 ret = s5m8767_get_voltage_register(rdev, &reg);
391 if (ret) 390 if (ret)
392 return ret; 391 return ret;
393 392
394 s5m_reg_read(s5m8767->iodev, reg, &val); 393 s5m_reg_read(s5m8767->iodev, reg, &val);
395 val = val & mask; 394 val &= ~mask;
395 val |= sel;
396 396
397 ret = s5m_reg_write(s5m8767->iodev, reg, val); 397 ret = s5m_reg_write(s5m8767->iodev, reg, val);
398 *selector = i; 398 *selector = sel;
399 399
400 return ret; 400 return ret;
401} 401}