Merge branch 'akpm' (patches from Andrew)
[linux-2.6-microblaze.git] / drivers / mmc / host / mmc_spi.c
index 3d28a3d..f4c8e1a 100644 (file)
@@ -180,7 +180,7 @@ static int mmc_spi_skip(struct mmc_spi_host *host, unsigned long timeout,
        u8 *cp = host->data->status;
        unsigned long start = jiffies;
 
-       while (1) {
+       do {
                int             status;
                unsigned        i;
 
@@ -193,16 +193,9 @@ static int mmc_spi_skip(struct mmc_spi_host *host, unsigned long timeout,
                                return cp[i];
                }
 
-               if (time_is_before_jiffies(start + timeout))
-                       break;
-
-               /* If we need long timeouts, we may release the CPU.
-                * We use jiffies here because we want to have a relation
-                * between elapsed time and the blocking of the scheduler.
-                */
-               if (time_is_before_jiffies(start + 1))
-                       schedule();
-       }
+               /* If we need long timeouts, we may release the CPU */
+               cond_resched();
+       } while (time_is_after_jiffies(start + timeout));
        return -ETIMEDOUT;
 }