diff options
author | Manuel Lauss <mano@roarinelk.homelinux.net> | 2008-06-09 02:39:11 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-07-15 08:14:43 -0400 |
commit | 88b8d9a83431237bf3eec1f2968f763607811171 (patch) | |
tree | dccda694012ecf0a054fba2952e5e1c84969c2e8 /drivers/mmc | |
parent | 5c0a889df56c9f6c5a68ec7aa222082569b35fd9 (diff) |
au1xmmc: abort requests early if no card is present.
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/au1xmmc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/mmc/host/au1xmmc.c b/drivers/mmc/host/au1xmmc.c index fcbaf40e3553..718eb879587f 100644 --- a/drivers/mmc/host/au1xmmc.c +++ b/drivers/mmc/host/au1xmmc.c | |||
@@ -697,6 +697,13 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) | |||
697 | host->mrq = mrq; | 697 | host->mrq = mrq; |
698 | host->status = HOST_S_CMD; | 698 | host->status = HOST_S_CMD; |
699 | 699 | ||
700 | /* fail request immediately if no card is present */ | ||
701 | if (0 == au1xmmc_card_inserted(host)) { | ||
702 | mrq->cmd->error = -ENOMEDIUM; | ||
703 | au1xmmc_finish_request(host); | ||
704 | return; | ||
705 | } | ||
706 | |||
700 | if (mrq->data) { | 707 | if (mrq->data) { |
701 | FLUSH_FIFO(host); | 708 | FLUSH_FIFO(host); |
702 | ret = au1xmmc_prepare_data(host, mrq->data); | 709 | ret = au1xmmc_prepare_data(host, mrq->data); |