diff options
Diffstat (limited to 'drivers/mmc/mmc_block.c')
-rw-r--r-- | drivers/mmc/mmc_block.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index 95b0da6abe87..63fbde8756ac 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -491,11 +491,20 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) | |||
491 | 491 | ||
492 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); | 492 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); |
493 | 493 | ||
494 | /* | 494 | if (!mmc_card_sd(card) && mmc_card_blockaddr(card)) { |
495 | * The CSD capacity field is in units of read_blkbits. | 495 | /* |
496 | * set_capacity takes units of 512 bytes. | 496 | * The EXT_CSD sector count is in number or 512 byte |
497 | */ | 497 | * sectors. |
498 | set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); | 498 | */ |
499 | set_capacity(md->disk, card->ext_csd.sectors); | ||
500 | } else { | ||
501 | /* | ||
502 | * The CSD capacity field is in units of read_blkbits. | ||
503 | * set_capacity takes units of 512 bytes. | ||
504 | */ | ||
505 | set_capacity(md->disk, | ||
506 | card->csd.capacity << (card->csd.read_blkbits - 9)); | ||
507 | } | ||
499 | return md; | 508 | return md; |
500 | 509 | ||
501 | err_putdisk: | 510 | err_putdisk: |