提交 e36c1df8 编写于 作者: A Axel Lin 提交者: Liam Girdwood

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: NAxel Lin <axel.lin@gmail.com>
Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: NLiam Girdwood <lrg@slimlogic.co.uk>
上级 aa7a7404
......@@ -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",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册