Skip to content

Commit

Permalink
mmc: only set op_cond_pending if IN_PROGRESS is returned
Browse files Browse the repository at this point in the history
  • Loading branch information
tkisky committed Dec 30, 2014
1 parent 7030ef0 commit c0260ca
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/mmc/mmc.c
Expand Up @@ -384,16 +384,21 @@ static int mmc_send_op_cond(struct mmc *mmc)
mmc_go_idle(mmc);

/* Asking to the card its capabilities */
mmc->op_cond_pending = 1;
for (i = 0; i < 2; i++) {
err = mmc_send_op_cond_iter(mmc, &cmd, i != 0);
if (err)
return err;

/* exit if not busy (flag seems to be inverted) */
if (mmc->op_cond_response & OCR_BUSY)
if (cmd.response[0] & OCR_BUSY) {
mmc->version = MMC_VERSION_UNKNOWN;
mmc->ocr = cmd.response[0];
mmc->high_capacity = ((mmc->ocr & OCR_HCS) == OCR_HCS);
mmc->rca = 1;
return 0;
}
}
mmc->op_cond_pending = 1;
return IN_PROGRESS;
}

Expand Down

0 comments on commit c0260ca

Please sign in to comment.