summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorMarc-André Hébert <hebert.marcandre@gmail.com>2011-01-31 18:31:24 +0100
committerChris Ball <cjb@laptop.org>2011-03-15 18:48:23 +0100
commit3362177fe1b7c23ee8497ee720ab4d6f6ba0b840 (patch)
tree2a8d0e82d943316a0691a9e030963c5ded831779 /drivers/mmc/card
parentmmc: export eMMC4.4 enhanced area details to sysfs (diff)
downloadlinux-3362177fe1b7c23ee8497ee720ab4d6f6ba0b840.tar.xz
linux-3362177fe1b7c23ee8497ee720ab4d6f6ba0b840.zip
mmc: Fix the block device read only flag
While the MMC handled the card's read only flag correctly on open, it did not setup the flag in the allocated disk structure. The consequence being that probing the /sys/class/block/mmcblkX/ro attribute always reported 0. Signed-off-by: Marc-Andre Hebert <hebert.marcandre@gmail.com> Reviewed-by: Chris Ball <cjb@laptop.org> Tested-by: Chris Ball <cjb@laptop.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index bfc8a8ae55df..61d233a7c118 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -621,6 +621,7 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
md->disk->private_data = md;
md->disk->queue = md->queue.queue;
md->disk->driverfs_dev = &card->dev;
+ set_disk_ro(md->disk, md->read_only);
/*
* As discussed on lkml, GENHD_FL_REMOVABLE should: