[PATCH] mmc: In mmc_power_up, use previously selected ocr ifavailable

From: Balaji Rao
Date: Mon Feb 09 2009 - 08:28:43 EST


When mmc_power_up is called during unsafe resume, host->ocr should be
used instead of host->ocr_avail.

Signed-off-by: Balaji Rao <balajirrao@xxxxxxxxxxxx>
Cc: Andy Green <andy@xxxxxxxxxxxx>
Cc: Pierre Ossman <drzeus-mmc@xxxxxxxxx>
---
drivers/mmc/core/core.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index df6ce4a..3ad7f87 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -572,7 +572,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)) {
--
1.6.0.6
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/