Skip to contentSkip to conversation

regulator: max8925: Use DIV_ROUND_UP in max8925_set_dvm_voltage

PATCH Applied Axel Lin 2 participants 2 messages Mar 13, 2012 Voltage and current regulator framework

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 regulator: max8925: Use DIV_ROUND_UP in max8925_set_dvm_voltage

Use DIV_ROUND_UP macro for better readability.

---
 drivers/regulator/max8925-regulator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/regulator/max8925-regulator.c +1 -1
index cc290d3..eb045f1 100644
@@ -140,7 +140,7 @@ static int max8925_set_dvm_voltage(struct regulator_dev *rdev, int uV)
 	if (uV < SD1_DVM_VMIN || uV > SD1_DVM_VMAX)
 		return -EINVAL;
 
-	data = (uV - SD1_DVM_VMIN + SD1_DVM_STEP - 1) / SD1_DVM_STEP;
+	data = DIV_ROUND_UP(uV - SD1_DVM_VMIN, SD1_DVM_STEP);
 	data <<= SD1_DVM_SHIFT;
 	mask = 3 << SD1_DVM_SHIFT;
 
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 1 line · Axel Lin

Use DIV_ROUND_UP macro for better readability.

Applied, thanks.