diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2017-11-14 23:55:20 +0100 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-12-11 12:44:29 +0100 |
commit | 96455380ece1c786f0a8822ea8b312e6445a3d93 (patch) | |
tree | 05387bc26e57f24f15ed094bdda4b34cc134e463 /drivers/mmc/core/core.h | |
parent | 97618aca1440b5addc5c3d78659d3e176be23b80 (diff) | |
download | linux-96455380ece1c786f0a8822ea8b312e6445a3d93.tar.gz linux-96455380ece1c786f0a8822ea8b312e6445a3d93.tar.bz2 linux-96455380ece1c786f0a8822ea8b312e6445a3d93.zip |
mmc: core: use usleep_range rather than HZ magic in mmc_delay()
Documentation/timers/timers-howto.txt recommends to use usleep_range for
delays 1-20ms. Let's adhere to it. No need for messing with HZ and still
do busy looping these days.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/core.h')
-rw-r--r-- | drivers/mmc/core/core.h | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h index 71e6c6d7ceb7..b2877e2d740f 100644 --- a/drivers/mmc/core/core.h +++ b/drivers/mmc/core/core.h @@ -62,12 +62,10 @@ void mmc_set_initial_state(struct mmc_host *host); static inline void mmc_delay(unsigned int ms) { - if (ms < 1000 / HZ) { - cond_resched(); - mdelay(ms); - } else { + if (ms <= 20) + usleep_range(ms * 1000, ms * 1250); + else msleep(ms); - } } void mmc_rescan(struct work_struct *work); |