From 6ff325a2d85481cbe31dfbb74b4fd2d94c115300 Mon Sep 17 00:00:00 2001 From: Donggeun Kim Date: Thu, 7 Jul 2011 16:51:56 +0900 Subject: regulator: max8997: Fix setting inappropriate value for ramp_delay variable The ramp_delay variable can be set lower than the desired value. This patch fixes it. Signed-off-by: Donggeun Kim Signed-off-by: MyungJoo Ham Signed-off-by: KyungMin Park Acked-by: Mark Brown Signed-off-by: Liam Girdwood --- drivers/regulator/max8997.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/regulator/max8997.c') diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index f8940c603cf0..ad6628ca94f4 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -544,7 +544,8 @@ static int max8997_set_voltage_ldobuck(struct regulator_dev *rdev, rid == MAX8997_BUCK4 || rid == MAX8997_BUCK5) { /* If the voltage is increasing */ if (org < i) - udelay(desc->step * (i - org) / max8997->ramp_delay); + udelay(DIV_ROUND_UP(desc->step * (i - org), + max8997->ramp_delay)); } return ret; -- cgit v1.2.3