projects
/
profile
/
ivi
/
kernel-x86-ivi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
85c5d86
)
regulator: Use DIV_ROUND_CLOSEST in wm8350_isink_get_current
author
Axel Lin
<axel.lin@gmail.com>
Mon, 12 Mar 2012 02:17:56 +0000
(10:17 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Mon, 12 Mar 2012 10:48:18 +0000
(10:48 +0000)
DIV_ROUND_CLOSEST performs the computation (x + d/2)/d with better readability.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/wm8350-regulator.c
patch
|
blob
|
history
diff --git
a/drivers/regulator/wm8350-regulator.c
b/drivers/regulator/wm8350-regulator.c
index
4f46067
..
ab1e183
100644
(file)
--- a/
drivers/regulator/wm8350-regulator.c
+++ b/
drivers/regulator/wm8350-regulator.c
@@
-186,7
+186,7
@@
static int wm8350_isink_get_current(struct regulator_dev *rdev)
return 0;
}
- return
(isink_cur[val] + 50) / 100
;
+ return
DIV_ROUND_CLOSEST(isink_cur[val], 100)
;
}
/* turn on ISINK followed by DCDC */