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~4090^2~899 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=859cc17a0027e11614de33f3c5e9df9701a83c10;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 dd27b0783d52..f201bc47a54b 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -163,11 +163,7 @@ static struct mmc_blk_data *mmc_blk_get(struct gendisk *disk) static inline int mmc_get_devidx(struct gendisk *disk) { - int devmaj = MAJOR(disk_devt(disk)); - int devidx = MINOR(disk_devt(disk)) / perdev_minors; - - if (!devmaj) - devidx = disk->first_minor / perdev_minors; + int devidx = disk->first_minor / perdev_minors; return devidx; } @@ -2015,6 +2011,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card, md->disk->queue = md->queue.queue; md->disk->driverfs_dev = parent; set_disk_ro(md->disk, md->read_only || default_ro); + md->disk->flags = GENHD_FL_EXT_DEVT; if (area_type & MMC_BLK_DATA_AREA_RPMB) md->disk->flags |= GENHD_FL_NO_PART_SCAN;