summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSeungwon Jeon <tgih.jun@samsung.com>2011-10-25 04:43:12 +0400
committerChris Ball <cjb@laptop.org>2011-10-27 17:11:33 +0400
commit336c716ae2272c9a26a6f82976d0e077d8ca824e (patch)
tree7a4ce68933379570eef5dc3c6e2a9e166463c224 /drivers/mmc
parent9b68256cdef75204aa8a4583aa79dd7c081796b3 (diff)
downloadlinux-336c716ae2272c9a26a6f82976d0e077d8ca824e.tar.xz
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.c20
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)
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
}
- /* eMMC v4.5 or later */
- if (card->ext_csd.rev >= 6)
- card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
-
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];
if (ext_csd[EXT_CSD_ERASED_MEM_CONT])
card->erased_byte = 0xFF;
else
card->erased_byte = 0x0;
+ /* eMMC v4.5 or later */
if (card->ext_csd.rev >= 6) {
+ card->ext_csd.feature_support |= MMC_DISCARD_FEATURE;
+
card->ext_csd.generic_cmd6_time = 10 *
ext_csd[EXT_CSD_GENERIC_CMD6_TIME];
card->ext_csd.power_off_longtime = 10 *
ext_csd[EXT_CSD_POWER_OFF_LONG_TIME];
- } else
- card->ext_csd.generic_cmd6_time = 0;
- card->ext_csd.cache_size =
- ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
- ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
- ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
- ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+ card->ext_csd.cache_size =
+ ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 |
+ ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24;
+ }
out:
return err;