]> err.no Git - linux-2.6/commitdiff
mmc: Fix mmc_delay() function
authorPierre Ossman <drzeus@drzeus.cx>
Sun, 22 Oct 2006 20:13:10 +0000 (22:13 +0200)
committerPierre Ossman <drzeus@drzeus.cx>
Fri, 1 Dec 2006 17:27:23 +0000 (18:27 +0100)
Several fixes for mmc_delay():

 * Repair if-clause that was supposed to detect sub-hz delays.
 * Change yield() to cond_resched() as yield() no longer has the
   semantics we desire.
 * mmc_delay() is used to guarantee protocol delays, so we cannot
   return early (i.e. use _interruptable).

Based on patch by Amol Lad.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
drivers/mmc/mmc.c

index 1593a6a632cf77a7bb46c96eb73f568459ed746d..82b7643c165489685e8eafe9a17daf8071ce6dc5 100644 (file)
@@ -454,11 +454,11 @@ static void mmc_deselect_cards(struct mmc_host *host)
 
 static inline void mmc_delay(unsigned int ms)
 {
-       if (ms < HZ / 1000) {
-               yield();
+       if (ms < 1000 / HZ) {
+               cond_resched();
                mdelay(ms);
        } else {
-               msleep_interruptible (ms);
+               msleep(ms);
        }
 }