aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/sd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/core/sd.c')
-rw-r--r--drivers/mmc/core/sd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 7ef3b15c5e3d..26fc098d77cd 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -326,7 +326,7 @@ static struct device_type sd_type = {
326/* 326/*
327 * Handle the detection and initialisation of a card. 327 * Handle the detection and initialisation of a card.
328 * 328 *
329 * In the case of a resume, "curcard" will contain the card 329 * In the case of a resume, "oldcard" will contain the card
330 * we're trying to reinitialise. 330 * we're trying to reinitialise.
331 */ 331 */
332static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, 332static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
@@ -494,13 +494,13 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
494 * Check if read-only switch is active. 494 * Check if read-only switch is active.
495 */ 495 */
496 if (!oldcard) { 496 if (!oldcard) {
497 if (!host->ops->get_ro) { 497 if (!host->ops->get_ro || host->ops->get_ro(host) < 0) {
498 printk(KERN_WARNING "%s: host does not " 498 printk(KERN_WARNING "%s: host does not "
499 "support reading read-only " 499 "support reading read-only "
500 "switch. assuming write-enable.\n", 500 "switch. assuming write-enable.\n",
501 mmc_hostname(host)); 501 mmc_hostname(host));
502 } else { 502 } else {
503 if (host->ops->get_ro(host)) 503 if (host->ops->get_ro(host) > 0)
504 mmc_card_set_readonly(card); 504 mmc_card_set_readonly(card);
505 } 505 }
506 } 506 }