diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-08-02 12:54:56 +0800 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-08-08 17:15:08 +0100 |
commit | e69c499790a35ef5ad164fd99f0b691e138640da (patch) | |
tree | 430db4c82bb3c500c90596a1985d39040f09f8a4 /drivers/regulator | |
parent | 99cd25ce10249c7f9d7172fe2ed266b023cd3323 (diff) |
regulator: Ensure enough enable time for max8649
Integer division may truncate the result, thus max8649_enable_time() may return
slightly shorter enable time. This patch fixes it.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/max8649.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 30eb9e54f7ec..1062cf9f02dc 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c @@ -221,7 +221,7 @@ static int max8649_enable_time(struct regulator_dev *rdev) ret = (ret & MAX8649_RAMP_MASK) >> 5; rate = (32 * 1000) >> ret; /* uV/uS */ - return (voltage / rate); + return DIV_ROUND_UP(voltage, rate); } static int max8649_set_mode(struct regulator_dev *rdev, unsigned int mode) |