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;