diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-29 13:27:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-12-29 13:27:28 -0500 |
commit | bc781aa93e6dfa85aa251c8898f831031db55c49 (patch) | |
tree | a5e258c39e3013b24b1a6bb4d399159c11bfe020 /drivers | |
parent | 77f234f9d995c9b576b311a56f66db6837e598df (diff) | |
parent | d2b18394259ef621fd2a6322aa9934198fd87a6a (diff) |
Merge master.kernel.org:/home/rmk/linux-2.6-mmc
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/mmc_block.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index d91fcf7c317..abcf19116d7 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -359,7 +359,12 @@ static struct mmc_blk_data *mmc_blk_alloc(struct mmc_card *card) | |||
359 | md->block_bits = card->csd.read_blkbits; | 359 | md->block_bits = card->csd.read_blkbits; |
360 | 360 | ||
361 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); | 361 | blk_queue_hardsect_size(md->queue.queue, 1 << md->block_bits); |
362 | set_capacity(md->disk, card->csd.capacity); | 362 | |
363 | /* | ||
364 | * The CSD capacity field is in units of read_blkbits. | ||
365 | * set_capacity takes units of 512 bytes. | ||
366 | */ | ||
367 | set_capacity(md->disk, card->csd.capacity << (card->csd.read_blkbits - 9)); | ||
363 | } | 368 | } |
364 | out: | 369 | out: |
365 | return md; | 370 | return md; |
@@ -373,7 +378,7 @@ mmc_blk_set_blksize(struct mmc_blk_data *md, struct mmc_card *card) | |||
373 | 378 | ||
374 | mmc_card_claim_host(card); | 379 | mmc_card_claim_host(card); |
375 | cmd.opcode = MMC_SET_BLOCKLEN; | 380 | cmd.opcode = MMC_SET_BLOCKLEN; |
376 | cmd.arg = 1 << card->csd.read_blkbits; | 381 | cmd.arg = 1 << md->block_bits; |
377 | cmd.flags = MMC_RSP_R1; | 382 | cmd.flags = MMC_RSP_R1; |
378 | err = mmc_wait_for_cmd(card->host, &cmd, 5); | 383 | err = mmc_wait_for_cmd(card->host, &cmd, 5); |
379 | mmc_card_release_host(card); | 384 | mmc_card_release_host(card); |
@@ -412,10 +417,9 @@ static int mmc_blk_probe(struct mmc_card *card) | |||
412 | if (err) | 417 | if (err) |
413 | goto out; | 418 | goto out; |
414 | 419 | ||
415 | printk(KERN_INFO "%s: %s %s %dKiB %s\n", | 420 | printk(KERN_INFO "%s: %s %s %luKiB %s\n", |
416 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), | 421 | md->disk->disk_name, mmc_card_id(card), mmc_card_name(card), |
417 | (card->csd.capacity << card->csd.read_blkbits) / 1024, | 422 | get_capacity(md->disk) >> 1, mmc_blk_readonly(card)?"(ro)":""); |
418 | mmc_blk_readonly(card)?"(ro)":""); | ||
419 | 423 | ||
420 | mmc_set_drvdata(card, md); | 424 | mmc_set_drvdata(card, md); |
421 | add_disk(md->disk); | 425 | add_disk(md->disk); |