浏览代码

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>
Wolfram Sang 7 年之前
父节点
当前提交
96455380ec
共有 1 个文件被更改,包括 3 次插入5 次删除
  1. 3 5
      drivers/mmc/core/core.h

+ 3 - 5
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)
 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);
 		msleep(ms);
-	}
 }
 }
 
 
 void mmc_rescan(struct work_struct *work);
 void mmc_rescan(struct work_struct *work);