Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Liam Girdwood
e69c4997 99cd25ce

+1 -1
+1 -1
drivers/regulator/max8649.c
··· 221 221 ret = (ret & MAX8649_RAMP_MASK) >> 5; 222 222 rate = (32 * 1000) >> ret; /* uV/uS */ 223 223 224 - return (voltage / rate); 224 + return DIV_ROUND_UP(voltage, rate); 225 225 } 226 226 227 227 static int max8649_set_mode(struct regulator_dev *rdev, unsigned int mode)