summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-03-20 17:16:39 +0800
committerPeng Fan <Peng.Fan@freescale.com>2015-04-29 15:03:07 +0800
commit7c3831859b72cd253df8d604ad1da869b1e5a98a (patch)
tree433eb3d28078a3a7a0f8e214497cd9ce6a2d4556 /drivers
parent3e8e8e8ef19c08cc16008f5732ce656b7ec658ad (diff)
downloadu-boot-imx-7c3831859b72cd253df8d604ad1da869b1e5a98a.zip
u-boot-imx-7c3831859b72cd253df8d604ad1da869b1e5a98a.tar.gz
u-boot-imx-7c3831859b72cd253df8d604ad1da869b1e5a98a.tar.bz2
MLK-10453 mmc: fix possible unintialized ocr
This commit ca4113da25b42bce44a2e7998966a47352f11613 "mmc: fix OCR Polling" does not consider cmd structure, and may leave it in uninitialized state. We can directly use op_cond_response here, since until here, op_cond_response already get the OCR value from chip. Signed-off-by: Peng Fan <Peng.Fan@freescale.com> Suggested-by: Ye.Li <B37916@freescale.com> (cherry picked from commit a033d2d43904f27778ee6a44f3e35494f9f72152)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/mmc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 43a9a8a..5bc8d63 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -436,7 +436,10 @@ static int mmc_complete_op_cond(struct mmc *mmc)
}
mmc->version = MMC_VERSION_UNKNOWN;
- mmc->ocr = cmd.response[0];
+ if (mmc_host_is_spi(mmc))
+ mmc->ocr = cmd.response[0];
+ else
+ mmc->ocr = mmc->op_cond_response;
mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
mmc->rca = 1;