projects
/
GitHub
/
exynos8895
/
android_kernel_samsung_universal8895.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8148ed6
)
regulator: max1586: Use DIV_ROUND_UP macro to calculate selector
author
Axel Lin
<axel.lin@gmail.com>
Fri, 2 Mar 2012 08:22:01 +0000
(16:22 +0800)
committer
Mark Brown
<broonie@opensource.wolfsonmicro.com>
Sun, 11 Mar 2012 20:48:49 +0000
(20:48 +0000)
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/max1586.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/regulator/max1586.c
b/drivers/regulator/max1586.c
index 40e7a4db28534268a746dcf54db3564c8b9ab098..282d2ee0604eb89eb16ea2b56e97bff02f50c76c 100644
(file)
--- a/
drivers/regulator/max1586.c
+++ b/
drivers/regulator/max1586.c
@@
-76,8
+76,8
@@
static int max1586_v3_set(struct regulator_dev *rdev, int min_uV, int max_uV,
if (min_uV < max1586->min_uV)
min_uV = max1586->min_uV;
- *selector =
((min_uV - max1586->min_uV) * MAX1586_V3_MAX_VSEL +
-
range_uV - 1) / range_uV
;
+ *selector =
DIV_ROUND_UP((min_uV - max1586->min_uV) *
+
MAX1586_V3_MAX_VSEL, range_uV)
;
if (max1586_v3_calc_voltage(max1586, *selector) > max_uV)
return -EINVAL;