From: Colin Cross <[email protected]>

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.

CC: Chris Ball <[email protected]>
CC: Arnd Bergmann <[email protected]>
CC: Dima Zavin <[email protected]>
Signed-off-by: Colin Cross <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
 drivers/mmc/card/block.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index edac9ac..f69f948 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -102,11 +102,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)) / perdev_minors;
-
-               if (!devmaj)
-                       devidx = md->disk->first_minor / perdev_minors;
+               int devidx = md->disk->first_minor / perdev_minors;
 
                blk_cleanup_queue(md->queue.queue);
 
@@ -623,6 +619,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;
        set_disk_ro(md->disk, md->read_only);
 
        /*
-- 
1.7.3.2.146.gca209

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to