projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
regulator: wm831x-dcdc: Ensure selected voltage falls within requested range
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
regulator
/
wm831x-dcdc.c
diff --git
a/drivers/regulator/wm831x-dcdc.c
b/drivers/regulator/wm831x-dcdc.c
index 782c228a19bd503ccda868ac67f46cce7fbba2e7..411cb12385aa3a5e159df2b0379a2e5685d3d1bf 100644
(file)
--- a/
drivers/regulator/wm831x-dcdc.c
+++ b/
drivers/regulator/wm831x-dcdc.c
@@
-223,7
+223,7
@@
static int wm831x_buckv_map_voltage(struct regulator_dev *rdev,
if (min_uV < 600000)
vsel = 0;
else if (min_uV <= 1800000)
- vsel =
((min_uV - 600000) /
12500) + 8;
+ vsel =
DIV_ROUND_UP(min_uV - 600000,
12500) + 8;
else
return -EINVAL;