From: Marc-André Hébert Date: Mon, 31 Jan 2011 17:31:24 +0000 (-0500) Subject: mmc: Fix the block device read only flag X-Git-Tag: upstream/snapshot3+hdmi~11159^2~51 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3362177fe1b7c23ee8497ee720ab4d6f6ba0b840;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git 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 Reviewed-by: Chris Ball Tested-by: Chris Ball Signed-off-by: Chris Ball --- 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: