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: v3.0.35-fsl~1103 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=69bfa1511140ee7a686bee091db71a91072736f6;p=karo-tx-linux.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 453695e29e3c..c97ada2af756 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -136,11 +136,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; } @@ -1293,6 +1289,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; /* * As discussed on lkml, GENHD_FL_REMOVABLE should: