From: Axel Lin Date: Mon, 11 Jun 2012 05:14:50 +0000 (+0800) Subject: regulator: core: Return correct delay time in regulator_set_voltage_time_sel X-Git-Tag: firefly_0821_release~3680^2~2413^2^2~113 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=578df8babf3b1895d562e1ea0d3a81d1e77e0182;p=firefly-linux-kernel-4.4.55.git regulator: core: Return correct delay time in regulator_set_voltage_time_sel rdev->desc->uV_step * abs(new_selector - old_selector) returns uV. The unit of ramp_delay is mV/us. Current code multiples 1000 at wrong place. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index ff76abde3ab3..6ffca9b32388 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -2299,7 +2299,7 @@ int regulator_set_voltage_time_sel(struct regulator_dev *rdev, if (rdev->desc->ramp_delay && rdev->desc->uV_step) return DIV_ROUND_UP(rdev->desc->uV_step * abs(new_selector - old_selector), - rdev->desc->ramp_delay) * 1000; + rdev->desc->ramp_delay * 1000); return 0; }