From 500f35648e5ebd04be00f974738a9db959a892b8 Mon Sep 17 00:00:00 2001 From: Balaji Rao Date: Tue, 22 Sep 2009 16:44:18 -0700 Subject: [PATCH] mmc: in mmc_power_up(), use previously selected ocr if available When mmc_power_up is called during unsafe resume, host->ocr should be used instead of host->ocr_avail. Signed-off-by: Balaji Rao Cc: Andy Green Cc: Pierre Ossman Cc: Ian Molton Cc: "Roberto A. Foglietta" Cc: Philip Langdale Acked-by: Matt Fleming Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mmc/core/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index d84c880fac84..e22d2b5576ec 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c @@ -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)) { -- 2.20.1