diff options
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r-- | drivers/mmc/card/block.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index 85f0e8cd875b..1f552c6e7579 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -85,7 +85,14 @@ static void mmc_blk_put(struct mmc_blk_data *md) | |||
85 | mutex_lock(&open_lock); | 85 | mutex_lock(&open_lock); |
86 | md->usage--; | 86 | md->usage--; |
87 | if (md->usage == 0) { | 87 | if (md->usage == 0) { |
88 | int devmaj = MAJOR(disk_devt(md->disk)); | ||
88 | int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT; | 89 | int devidx = MINOR(disk_devt(md->disk)) >> MMC_SHIFT; |
90 | |||
91 | if (!devmaj) | ||
92 | devidx = md->disk->first_minor >> MMC_SHIFT; | ||
93 | |||
94 | blk_cleanup_queue(md->queue.queue); | ||
95 | |||
89 | __clear_bit(devidx, dev_use); | 96 | __clear_bit(devidx, dev_use); |
90 | 97 | ||
91 | put_disk(md->disk); | 98 | put_disk(md->disk); |
@@ -613,6 +620,7 @@ static int mmc_blk_probe(struct mmc_card *card) | |||
613 | return 0; | 620 | return 0; |
614 | 621 | ||
615 | out: | 622 | out: |
623 | mmc_cleanup_queue(&md->queue); | ||
616 | mmc_blk_put(md); | 624 | mmc_blk_put(md); |
617 | 625 | ||
618 | return err; | 626 | return err; |