aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2007-06-13 13:06:03 -0400
committerPierre Ossman <drzeus@drzeus.cx>2007-06-13 13:11:20 -0400
commitc3bff2ec10b8bf2f53c954e370f9bdae93064472 (patch)
treed62fb7cf14e7302e83c35b64c901f42284f93703
parent0107a4b32e36dccd4456e2c5e34c5cd22c94e094 (diff)
mmc: get back read-only switch function
Somehow the code to read the read-only switch of SD cards got lost in the reorganisation. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
-rw-r--r--drivers/mmc/core/sd.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 41bfb5dfe6ff..918477c490b0 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -427,6 +427,21 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
427 mmc_set_bus_width(host, MMC_BUS_WIDTH_4); 427 mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
428 } 428 }
429 429
430 /*
431 * Check if read-only switch is active.
432 */
433 if (!oldcard) {
434 if (!host->ops->get_ro) {
435 printk(KERN_WARNING "%s: host does not "
436 "support reading read-only "
437 "switch. assuming write-enable.\n",
438 mmc_hostname(host));
439 } else {
440 if (host->ops->get_ro(host))
441 mmc_card_set_readonly(card);
442 }
443 }
444
430 if (!oldcard) 445 if (!oldcard)
431 host->card = card; 446 host->card = card;
432 447