Thread (2 messages) 2 messages, 2 authors, 2011-01-31
STALE5598d

[PATCH] MMC: Fix the block device read only flag

From: Marc-André Hébert <hidden>
Date: 2011-01-31 16:42:18
Subsystem: multimedia card (mmc), secure digital (sd) and sdio subsystem, the rest · Maintainers: Ulf Hansson, Linus Torvalds

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 <redacted>
---
 drivers/mmc/card/block.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index bfc8a8a..61d233a 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:
-- 
1.6.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help