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-03-20 18:01:39 +0800
commita033d2d43904f27778ee6a44f3e35494f9f72152 (patch)
treef9f8c2de6679ddaac6f9d32af53cc982bed5a042 /drivers
parente0b316f071aa17c8e41a50f395346ab9f012e665 (diff)
downloadu-boot-imx-a033d2d43904f27778ee6a44f3e35494f9f72152.zip
u-boot-imx-a033d2d43904f27778ee6a44f3e35494f9f72152.tar.gz
u-boot-imx-a033d2d43904f27778ee6a44f3e35494f9f72152.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>
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 b016cb0..4ea986f 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -432,7 +432,10 @@ 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;