regulator: Ensure enough delay time for enabling regulator
Integer division will truncate the result, this patch ensures we have enough delay time for enabling regulator. 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>
This commit is contained in:
parent
aa7a74040a
commit
e36c1df8e1
|
@ -1312,10 +1312,12 @@ static int _regulator_enable(struct regulator_dev *rdev)
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (delay >= 1000)
|
||||
if (delay >= 1000) {
|
||||
mdelay(delay / 1000);
|
||||
else if (delay)
|
||||
udelay(delay % 1000);
|
||||
} else if (delay) {
|
||||
udelay(delay);
|
||||
}
|
||||
|
||||
} else if (ret < 0) {
|
||||
printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n",
|
||||
|
|
Loading…
Reference in New Issue