projects
/
GitHub
/
LineageOS
/
G12
/
android_kernel_amlogic_linux-4.9.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d770e55
)
regulator: qcom_spmi-regulator: Use DIV_ROUND_UP instead of open-coded
author
Axel Lin
<axel.lin@ingics.com>
Thu, 9 Jul 2015 08:48:50 +0000
(16:48 +0800)
committer
Mark Brown
<broonie@kernel.org>
Thu, 9 Jul 2015 18:02:42 +0000
(19:02 +0100)
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/qcom_spmi-regulator.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/regulator/qcom_spmi-regulator.c
b/drivers/regulator/qcom_spmi-regulator.c
index 850a30a95b5b82149ed183960f9b746c88f764b6..9ef0e2f28ec4bd61d5f7f14559e5998f1b0e0af7 100644
(file)
--- a/
drivers/regulator/qcom_spmi-regulator.c
+++ b/
drivers/regulator/qcom_spmi-regulator.c
@@
-504,8
+504,7
@@
static int spmi_regulator_select_voltage(struct spmi_regulator *vreg,
* Force uV to be an allowed set point by applying a ceiling function to
* the uV value.
*/
- *voltage_sel = (uV - range->min_uV + range->step_uV - 1)
- / range->step_uV;
+ *voltage_sel = DIV_ROUND_UP(uV - range->min_uV, range->step_uV);
uV = *voltage_sel * range->step_uV + range->min_uV;
if (uV > max_uV) {