From: Dmitry Osipenko Date: Sun, 30 Aug 2020 18:53:52 +0000 (+0300) Subject: regmap: Use flexible sleep X-Git-Tag: v5.10.7~1468^2^2~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2b32d2f7ce0a54ce74a75f0d939b5ee063a05ec5;p=platform%2Fkernel%2Flinux-rpi.git 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: Dmitry Osipenko Link: https://lore.kernel.org/r/20200830185356.5365-3-digetx@gmail.com Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index e93700a..a417cb1a 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -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; }