Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3bff2ec10b8bf2f53c954e370f9bdae93064472
Commit:     c3bff2ec10b8bf2f53c954e370f9bdae93064472
Parent:     0107a4b32e36dccd4456e2c5e34c5cd22c94e094
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Wed Jun 13 19:06:03 2007 +0200
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Wed Jun 13 19:11:20 2007 +0200

    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 <[EMAIL PROTECTED]>
---
 drivers/mmc/core/sd.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 41bfb5d..918477c 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,
                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;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to