Commit 96455380 authored by Wolfram Sang's avatar Wolfram Sang Committed by Ulf Hansson

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 97618aca
...@@ -62,12 +62,10 @@ void mmc_set_initial_state(struct mmc_host *host); ...@@ -62,12 +62,10 @@ void mmc_set_initial_state(struct mmc_host *host);
static inline void mmc_delay(unsigned int ms) static inline void mmc_delay(unsigned int ms)
{ {
if (ms < 1000 / HZ) { if (ms <= 20)
cond_resched(); usleep_range(ms * 1000, ms * 1250);
mdelay(ms); else
} else {
msleep(ms); msleep(ms);
}
} }
void mmc_rescan(struct work_struct *work); void mmc_rescan(struct work_struct *work);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment