summaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorAndrew Gabbasov <andrew_gabbasov@mentor.com>2015-03-19 07:44:03 -0500
committerPantelis Antoniou <pantelis.antoniou@konsulko.com>2015-05-05 11:53:52 +0300
commita626c8d418d5fd1f8429294e7efe3fa2e4ca90fe (patch)
treeedf39f78ca6b7028f34f041373fbda83840ee6c3 /drivers/mmc
parent3f2da751beb84861ba0a999aaea09e73f578022a (diff)
downloadblackbird-obmc-uboot-a626c8d418d5fd1f8429294e7efe3fa2e4ca90fe.tar.gz
blackbird-obmc-uboot-a626c8d418d5fd1f8429294e7efe3fa2e4ca90fe.zip
mmc: Avoid extra duplicate entry in mmc device structure
The 'op_cond_response' field in mmc structure contains the response from the last SEND_OP_COND MMC command while making iterational polling of the card. Later it is copied to 'ocr' field, designed to contain the OCR register value, which is actually the same response from the same command. So, these fields have actually the same data, just in different time periods. It's easier to use the same 'ocr' field in both cases at once, without temporary using of the 'op_cond_response' field. Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index a13769ea25..fe00a193a6 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -362,8 +362,8 @@ static int mmc_send_op_cond_iter(struct mmc *mmc, struct mmc_cmd *cmd,
if (use_arg && !mmc_host_is_spi(mmc)) {
cmd->cmdarg =
(mmc->cfg->voltages &
- (mmc->op_cond_response & OCR_VOLTAGE_MASK)) |
- (mmc->op_cond_response & OCR_ACCESS_MODE);
+ (mmc->ocr & OCR_VOLTAGE_MASK)) |
+ (mmc->ocr & OCR_ACCESS_MODE);
if (mmc->cfg->host_caps & MMC_MODE_HC)
cmd->cmdarg |= OCR_HCS;
@@ -371,7 +371,7 @@ static int mmc_send_op_cond_iter(struct mmc *mmc, struct mmc_cmd *cmd,
err = mmc_send_cmd(mmc, cmd, NULL);
if (err)
return err;
- mmc->op_cond_response = cmd->response[0];
+ mmc->ocr = cmd->response[0];
return 0;
}
@@ -391,7 +391,7 @@ static int mmc_send_op_cond(struct mmc *mmc)
return err;
/* exit if not busy (flag seems to be inverted) */
- if (mmc->op_cond_response & OCR_BUSY)
+ if (mmc->ocr & OCR_BUSY)
return 0;
}
return IN_PROGRESS;
@@ -413,7 +413,7 @@ static int mmc_complete_op_cond(struct mmc *mmc)
if (get_timer(start) > timeout)
return UNUSABLE_ERR;
udelay(100);
- } while (!(mmc->op_cond_response & OCR_BUSY));
+ } while (!(mmc->ocr & OCR_BUSY));
if (mmc_host_is_spi(mmc)) { /* read OCR for spi */
cmd.cmdidx = MMC_CMD_SPI_READ_OCR;
@@ -424,10 +424,11 @@ static int mmc_complete_op_cond(struct mmc *mmc)
if (err)
return err;
+
+ mmc->ocr = cmd.response[0];
}
mmc->version = MMC_VERSION_UNKNOWN;
- mmc->ocr = cmd.response[0];
mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
mmc->rca = 1;
OpenPOWER on IntegriCloud