提交 88b8d9a8 编写于 作者: M Manuel Lauss 提交者: Pierre Ossman

au1xmmc: abort requests early if no card is present.

Don't process an MMC request if no card is present.
Signed-off-by: NManuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: NPierre Ossman <drzeus@drzeus.cx>
上级 5c0a889d
...@@ -697,6 +697,13 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq) ...@@ -697,6 +697,13 @@ static void au1xmmc_request(struct mmc_host* mmc, struct mmc_request* mrq)
host->mrq = mrq; host->mrq = mrq;
host->status = HOST_S_CMD; 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) { if (mrq->data) {
FLUSH_FIFO(host); FLUSH_FIFO(host);
ret = au1xmmc_prepare_data(host, mrq->data); ret = au1xmmc_prepare_data(host, mrq->data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册