diff options
author | Seungwon Jeon <tgih.jun@samsung.com> | 2011-10-24 20:43:12 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-27 09:11:33 -0400 |
commit | 336c716ae2272c9a26a6f82976d0e077d8ca824e (patch) | |
tree | 7a4ce68933379570eef5dc3c6e2a9e166463c224 /drivers/mmc | |
parent | 9b68256cdef75204aa8a4583aa79dd7c081796b3 (diff) |
mmc: core: Cleanup eMMC4.5 conditionals
Code cleanup, putting all eMMC 4.5 detection cases together.
This patch removes one if-statement and assembles all. And it also
removes variable initialization below else-statement -- all members
of card structure are already set to zero at card-init.
Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/mmc.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index fb5bf01dd1b2..36270449dd9d 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) | |||
467 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; | 467 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; |
468 | } | 468 | } |
469 | 469 | ||
470 | /* eMMC v4.5 or later */ | ||
471 | if (card->ext_csd.rev >= 6) | ||
472 | card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; | ||
473 | |||
474 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; | 470 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; |
475 | if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) | 471 | if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) |
476 | card->erased_byte = 0xFF; | 472 | card->erased_byte = 0xFF; |
477 | else | 473 | else |
478 | card->erased_byte = 0x0; | 474 | card->erased_byte = 0x0; |
479 | 475 | ||
476 | /* eMMC v4.5 or later */ | ||
480 | if (card->ext_csd.rev >= 6) { | 477 | if (card->ext_csd.rev >= 6) { |
478 | card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; | ||
479 | |||
481 | card->ext_csd.generic_cmd6_time = 10 * | 480 | card->ext_csd.generic_cmd6_time = 10 * |
482 | ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; | 481 | ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; |
483 | card->ext_csd.power_off_longtime = 10 * | 482 | card->ext_csd.power_off_longtime = 10 * |
484 | ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; | 483 | ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; |
485 | } else | ||
486 | card->ext_csd.generic_cmd6_time = 0; | ||
487 | 484 | ||
488 | card->ext_csd.cache_size = | 485 | card->ext_csd.cache_size = |
489 | ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | | 486 | ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | |
490 | ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | | 487 | ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | |
491 | ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | | 488 | ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | |
492 | ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; | 489 | ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; |
490 | } | ||
493 | 491 | ||
494 | out: | 492 | out: |
495 | return err; | 493 | return err; |