未验证 提交 2b32d2f7 编写于 作者: D Dmitry Osipenko 提交者: Mark Brown

regmap: Use flexible sleep

The multi-reg write function uses udelay(), which is a busy-loop based
delaying function that is not suitable for a long delays. Hence let's
replace the udelay() with fsleep(), which is flexible sleep function that
selects best delay function based on the delay-time.
Signed-off-by: NDmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200830185356.5365-3-digetx@gmail.comSigned-off-by: NMark Brown <broonie@kernel.org>
上级 7f9fb673
......@@ -2231,7 +2231,7 @@ static int _regmap_range_multi_paged_reg_write(struct regmap *map,
return ret;
if (regs[i].delay_us)
udelay(regs[i].delay_us);
fsleep(regs[i].delay_us);
base += n;
n = 0;
......@@ -2268,7 +2268,7 @@ static int _regmap_multi_reg_write(struct regmap *map,
return ret;
if (regs[i].delay_us)
udelay(regs[i].delay_us);
fsleep(regs[i].delay_us);
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册