mmc: in mmc_power_up(), use previously selected ocr if available
authorBalaji Rao <[email protected]>
Tue, 22 Sep 2009 23:44:18 +0000 (16:44 -0700)
committerLinus Torvalds <[email protected]>
Wed, 23 Sep 2009 14:39:32 +0000 (07:39 -0700)
When mmc_power_up is called during unsafe resume, host->ocr should be used
instead of host->ocr_avail.

Signed-off-by: Balaji Rao <[email protected]>
Cc: Andy Green <[email protected]>
Cc: Pierre Ossman <[email protected]>
Cc: Ian Molton <[email protected]>
Cc: "Roberto A. Foglietta" <[email protected]>
Cc: Philip Langdale <[email protected]>
Acked-by: Matt Fleming <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/mmc/core/core.c

index d84c880fac84f41a0d388540d74d22a4a7649705..e22d2b5576ec1ed8e7e68f8f30588304fe714d19 100644 (file)
@@ -687,7 +687,13 @@ void mmc_set_timing(struct mmc_host *host, unsigned int timing)
  */
 static void mmc_power_up(struct mmc_host *host)
 {
-       int bit = fls(host->ocr_avail) - 1;
+       int bit;
+
+       /* If ocr is set, we use it */
+       if (host->ocr)
+               bit = ffs(host->ocr) - 1;
+       else
+               bit = fls(host->ocr_avail) - 1;
 
        host->ios.vdd = bit;
        if (mmc_host_is_spi(host)) {