diff options
author | Per Forlin <per.forlin@linaro.org> | 2011-08-29 09:35:58 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-10-26 16:32:04 -0400 |
commit | 7c8a2829c22a270acadc6aa3a937e2e7956b19f5 (patch) | |
tree | b787b429a1bd01f364e752fe5b52e2f95cb46875 /drivers/mmc | |
parent | 44669034815a7ad263542ac605c581a10b22d146 (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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/core/core.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 45ea968e7dd..0b4c2ed22bc 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -320,8 +320,14 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host, | |||
320 | mmc_wait_for_req_done(host, host->areq->mrq); | 320 | mmc_wait_for_req_done(host, host->areq->mrq); |
321 | err = host->areq->err_check(host->card, host->areq); | 321 | err = host->areq->err_check(host->card, host->areq); |
322 | if (err) { | 322 | if (err) { |
323 | /* post process the completed failed request */ | ||
323 | mmc_post_req(host, host->areq->mrq, 0); | 324 | mmc_post_req(host, host->areq->mrq, 0); |
324 | if (areq) | 325 | if (areq) |
326 | /* | ||
327 | * Cancel the new prepared request, because | ||
328 | * it can't run until the failed | ||
329 | * request has been properly handled. | ||
330 | */ | ||
325 | mmc_post_req(host, areq->mrq, -EINVAL); | 331 | mmc_post_req(host, areq->mrq, -EINVAL); |
326 | 332 | ||
327 | host->areq = NULL; | 333 | host->areq = NULL; |