summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorPer Forlin <per.forlin@linaro.org>2011-08-29 15:35:58 +0200
committerUlf HANSSON <ulf.hansson@stericsson.com>2011-10-10 12:18:19 +0200
commita36ce8817ea0748a691c83529ac36913fbb8587d (patch)
treeef7fed54ef98e5046f33d19e926e85ab148bc579 /drivers/mmc
parentf503d030be0747c6fa739cf146ec34154c32cbbb (diff)
mmc: core: clarify how to use post_req in case of errors
The err condition in post_req() is set to undo a call made to pre_req() that hasn't been started yet. The err condition is not set if an MMC request returns an error. Signed-off-by: Per Forlin <per.forlin@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Chris Ball <cjb@laptop.org> Change-Id: Ie91c9868301c654ae27937b666089d82017b75f2 Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33433 Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com> Tested-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/core/core.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index e473446073e..ddcfae84fe8 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -319,8 +319,14 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
mmc_wait_for_req_done(host, host->areq->mrq);
err = host->areq->err_check(host->card, host->areq);
if (err) {
+ /* post process the completed failed request */
mmc_post_req(host, host->areq->mrq, 0);
if (areq)
+ /*
+ * Cancel the new prepared request, because
+ * it can't run until the failed
+ * request has been properly handled.
+ */
mmc_post_req(host, areq->mrq, -EINVAL);
host->areq = NULL;