diff mbox

[v2] sdio: skip initialization on powered resume

Message ID 477F20668A386D41ADCC57781B1F704307D2FE4A0F@SC-VEXCH1.marvell.com (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Bing Zhao Sept. 8, 2010, 1:03 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index f332c52..37f64d6 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -434,28 +434,32 @@  static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
 		goto finish;
 	}
 
-	/*
-	 * Read the common registers.
-	 */
-	err = sdio_read_cccr(card);
-	if (err)
-		goto remove;
+	if (!powered_resume) {
+		/*
+		 * Read the common registers.
+		 */
+		err = sdio_read_cccr(card);
+		if (err)
+			goto remove;
 
-	/*
-	 * Read the common CIS tuples.
-	 */
-	err = sdio_read_common_cis(card);
-	if (err)
-		goto remove;
+		/*
+		 * Read the common CIS tuples.
+		 */
+		err = sdio_read_common_cis(card);
+		if (err)
+			goto remove;
+	}
 
 	if (oldcard) {
-		int same = (card->cis.vendor == oldcard->cis.vendor &&
-			    card->cis.device == oldcard->cis.device);
 		mmc_remove_card(card);
-		if (!same)
-			return -ENOENT;
 
-		card = oldcard;
+		if (!powered_resume) {
+			int same = (card->cis.vendor == oldcard->cis.vendor &&
+				    card->cis.device == oldcard->cis.device);
+			if (!same)
+				return -ENOENT;
+		}
+
 		return 0;
 	}