linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: per.forlin@linaro.org (Per Forlin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] mmc: mmci: simplify err check in mmci_post_request
Date: Mon, 29 Aug 2011 15:35:59 +0200	[thread overview]
Message-ID: <1314624959-4634-3-git-send-email-per.forlin@linaro.org> (raw)
In-Reply-To: <1314624959-4634-1-git-send-email-per.forlin@linaro.org>

The error condition indicates that mmci_post_request() should cleanup
after the mmci_pre_request(). In this case the resources allocated by
device_prep_slave_sg() are freed by calling dmaengine_terminate_all().
dma_unmap_sg() should always be performed if the host_cookie is set.

Signed-off-by: Per Forlin <per.forlin@linaro.org>
---
 drivers/mmc/host/mmci.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 56e9a41..40e4c05 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -529,7 +529,7 @@ static void mmci_post_request(struct mmc_host *mmc, struct mmc_request *mrq,
 	if (chan) {
 		if (err)
 			dmaengine_terminate_all(chan);
-		if (err || data->host_cookie)
+		if (data->host_cookie)
 			dma_unmap_sg(mmc_dev(host->mmc), data->sg,
 				     data->sg_len, dir);
 		mrq->data->host_cookie = 0;
-- 
1.7.4.1

  parent reply	other threads:[~2011-08-29 13:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-29 13:35 [PATCH 0/2] mmc: clarifications on host.post_req() Per Forlin
2011-08-29 13:35 ` [PATCH 1/2] mmc: core: clarify how to use post_req in case of errors Per Forlin
2011-09-12 14:05   ` Linus Walleij
2011-08-29 13:35 ` Per Forlin [this message]
2011-09-12 14:06   ` [PATCH 2/2] mmc: mmci: simplify err check in mmci_post_request Linus Walleij
2011-09-21 18:30 ` [PATCH 0/2] mmc: clarifications on host.post_req() Chris Ball
2011-09-21 18:43   ` Per Fridén Förlin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314624959-4634-3-git-send-email-per.forlin@linaro.org \
    --to=per.forlin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).