Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302244
b: refs/heads/master
c: 94e85a3
h: refs/heads/master
v: v3
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 23, 2012
1 parent ba4f5f6 commit 9b52100
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9b49af5efa405f3c394a6395e79092c785999a3
refs/heads/master: 94e85a3c5d702a4ce96b7a9b883c949a08ebd93c
5 changes: 4 additions & 1 deletion trunk/drivers/regulator/s5m8767.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,10 @@ static int s5m8767_convert_voltage_to_sel(
if (max_vol < desc->min || min_vol > desc->max)
return -EINVAL;

selector = (min_vol - desc->min) / desc->step;
if (min_vol < desc->min)
min_vol = desc->min;

selector = DIV_ROUND_UP(min_vol - desc->min, desc->step);

if (desc->min + desc->step * selector > max_vol)
return -EINVAL;
Expand Down

0 comments on commit 9b52100

Please sign in to comment.