From: Colin Cross Date: Fri, 3 Sep 2010 19:41:21 +0000 (-0700) Subject: mmc_block: Allow more than 8 partitions per card X-Git-Tag: firefly_0821_release~9833^2~5^2~130 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=057ac3a83f1c9386b78f42f5a76a7469acad4623;p=firefly-linux-kernel-4.4.55.git mmc_block: Allow more than 8 partitions per card Set the GENHD_FL_EXT_DEVT flag, which will allocate minor numbers in major 259 for partitions past disk->minors. Also remove the use of disk_devt to determine devidx from md->disk. md->disk->first_minor is always initialized from devidx and can always be used to recover it. Signed-off-by: Colin Cross --- diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 8a5dd72d47bd..7054fd5863a0 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -87,11 +87,7 @@ static void mmc_blk_put(struct mmc_blk_data *md) mutex_lock(&open_lock); md->usage--; if (md->usage == 0) { - int devmaj = MAJOR(disk_devt(md->disk)); - int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT; - - if (!devmaj) - devidx = md->disk->first_minor >> MMC_SHIFT; + int devidx = md->disk->first_minor >> MMC_SHIFT; blk_cleanup_queue(md->queue.queue); @@ -622,6 +618,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; + md->disk->flags = GENHD_FL_EXT_DEVT; /* * As discussed on lkml, GENHD_FL_REMOVABLE should: