From: Manuel Lauss Date: Mon, 9 Jun 2008 06:39:11 +0000 (+0200) Subject: au1xmmc: abort requests early if no card is present. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=88b8d9a83431237bf3eec1f2968f763607811171;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Pierre Ossman --- 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) 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);