Skip to content

Commit

Permalink
au1xmmc: abort requests early if no card is present.
Browse files Browse the repository at this point in the history
Don't process an MMC request if no card is present.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
  • Loading branch information
Manuel Lauss authored and Pierre Ossman committed Jul 15, 2008
1 parent 5c0a889 commit 88b8d9a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/mmc/host/au1xmmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,13 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
host->mrq = mrq;
host->status = HOST_S_CMD;

/* fail request immediately if no card is present */
if (0 == au1xmmc_card_inserted(host)) {
mrq->cmd->error = -ENOMEDIUM;
au1xmmc_finish_request(host);
return;
}

if (mrq->data) {
FLUSH_FIFO(host);
ret = au1xmmc_prepare_data(host, mrq->data);
Expand Down

0 comments on commit 88b8d9a

Please sign in to comment.