From: Jerry Huang <chang-ming.hu...@freescale.com>

power on before detecting card.

The driver will not get the right status when using the callback function 
'get_cd' to check if the card is present because the power is not on.
Therefore, the controller must be power on before detecting the card status.

Signed-off-by: Jerry Huang <chang-ming.hu...@freescale.com>
---
 drivers/mmc/core/core.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 7dab2e5..7b3aee1 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -1067,12 +1067,13 @@ void mmc_rescan(struct work_struct *work)
         */
        mmc_bus_put(host);
 
+       mmc_power_up(host);
+
        if (host->ops->get_cd && host->ops->get_cd(host) == 0)
                goto out;
 
        mmc_claim_host(host);
 
-       mmc_power_up(host);
        mmc_go_idle(host);
 
        mmc_send_if_cond(host, host->ocr_avail);
-- 
1.6.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to