@@ -470,8 +470,9 @@ EXPORT_SYMBOL(mmc_start_req);
*/
void mmc_wait_for_req(struct mmc_host *host, struct mmc_request *mrq)
{
- __mmc_start_req(host, mrq);
- mmc_wait_for_req_done(host, mrq);
+ /* If the card's been removed, don't wait for the request. */
+ if (!__mmc_start_req(host, mrq))
+ mmc_wait_for_req_done(host, mrq);
}
EXPORT_SYMBOL(mmc_wait_for_req);
@@ -468,7 +468,7 @@ msmsdcc_start_command_deferred(struct msmsdcc_host *host,
host->prog_enable = true;
}
- if (cmd == cmd->mrq->stop)
+ if (cmd->mrq && (cmd == cmd->mrq->stop))
*c |= MCI_CSPM_MCIABORT;
if (snoop_cccr_abort(cmd))
@@ -559,7 +559,7 @@ msmsdcc_start_data(struct msmsdcc_host *host, struct mmc_data *data,
static void
msmsdcc_start_command(struct msmsdcc_host *host, struct mmc_command *cmd, u32 c)
{
- if (cmd == cmd->mrq->stop)
+ if (cmd->mrq && (cmd == cmd->mrq->stop))
c |= MCI_CSPM_MCIABORT;
host->stats.cmds++;