diff options
author | Jurgen Heeks <jurgen.heeks@nokia.com> | 2012-02-01 13:30:55 +0100 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-02-13 20:39:02 -0500 |
commit | dd13b4ed4650bb3a7d6c86b549ab66a6aa0c00d8 (patch) | |
tree | e9f3de8df407802bf1a6cd58ef6d461d100b6320 /drivers | |
parent | 3e73c36b4dc224529d0b0c0d5d69c0dacd793c42 (diff) |
mmc: core: Fix comparison issue in mmc_compare_ext_csds
Found this issue during code review. Actually, there are two issues which
both compensate together in lucky case. In unlucky case the bus width
probing might not work as expected.
Signed-off-by: Jurgen Heeks <jurgen.heeks@nokia.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/core/mmc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 9be031934e33..a48066344fa8 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -376,7 +376,7 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) } card->ext_csd.raw_hc_erase_gap_size = - ext_csd[EXT_CSD_PARTITION_ATTRIBUTE]; + ext_csd[EXT_CSD_HC_WP_GRP_SIZE]; card->ext_csd.raw_sec_trim_mult = ext_csd[EXT_CSD_SEC_TRIM_MULT]; card->ext_csd.raw_sec_erase_mult = @@ -551,7 +551,7 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width) goto out; /* only compare read only fields */ - err = (!(card->ext_csd.raw_partition_support == + err = !((card->ext_csd.raw_partition_support == bw_ext_csd[EXT_CSD_PARTITION_SUPPORT]) && (card->ext_csd.raw_erased_mem_count == bw_ext_csd[EXT_CSD_ERASED_MEM_CONT]) && |