From 213434f7efb2458a8c475416e8b2ce4c82e1c1f7 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Wed, 13 Jun 2007 19:06:03 +0200 Subject: [PATCH] --- yaml --- r: 57696 b: refs/heads/master c: c3bff2ec10b8bf2f53c954e370f9bdae93064472 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mmc/core/sd.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 8fa492504220..44f068998173 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0107a4b32e36dccd4456e2c5e34c5cd22c94e094 +refs/heads/master: c3bff2ec10b8bf2f53c954e370f9bdae93064472 diff --git a/trunk/drivers/mmc/core/sd.c b/trunk/drivers/mmc/core/sd.c index 41bfb5dfe6ff..918477c490b0 100644 --- a/trunk/drivers/mmc/core/sd.c +++ b/trunk/drivers/mmc/core/sd.c @@ -427,6 +427,21 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, mmc_set_bus_width(host, MMC_BUS_WIDTH_4); } + /* + * Check if read-only switch is active. + */ + if (!oldcard) { + if (!host->ops->get_ro) { + printk(KERN_WARNING "%s: host does not " + "support reading read-only " + "switch. assuming write-enable.\n", + mmc_hostname(host)); + } else { + if (host->ops->get_ro(host)) + mmc_card_set_readonly(card); + } + } + if (!oldcard) host->card = card;