Commit 8e7e4852 authored by Russell King's avatar Russell King

[MMC] Add comment about GENHD_FL_REMOVABLE to mmc_block

We don't set GENHD_FL_REMOVABLE because this flag indicates that
the media may be removed while the block device persists.  Since
MMC destroys the block device when the card (media + on-board
controller) is removed, the block device will never exist without
media present.  Therefore, setting GENHD_FL_REMOVABLE would be
misleading.
Signed-off-by: default avatarRussell King <rmk@arm.linux.org.uk>
parent 62343f76
......@@ -332,6 +332,18 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card)
md->disk->queue = md->queue.queue;
md->disk->driverfs_dev = &card->dev;
/*
* As discussed on lkml, GENHD_FL_REMOVABLE should:
*
* - be set for removable media with permanent block devices
* - be unset for removable block devices with permanent media
*
* Since MMC block devices clearly fall under the second
* case, we do not set GENHD_FL_REMOVABLE. Userspace
* should use the block device creation/destruction hotplug
* messages to tell when the card is present.
*/
sprintf(md->disk->disk_name, "mmcblk%d", devidx);
sprintf(md->disk->devfs_name, "mmc/blk%d", devidx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment