linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@chromium.org>
To: Chris Ball <cjb@laptop.org>, Ulf Hansson <ulf.hansson@linaro.org>,
	Seungwon Jeon <tgih.jun@samsung.com>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Grant Grundler <grundler@chromium.org>
Subject: [PATCH 4/7] mmc: core: use common code path to return error
Date: Thu, 26 Sep 2013 12:22:57 -0700	[thread overview]
Message-ID: <1380223380-22451-5-git-send-email-grundler@chromium.org> (raw)
In-Reply-To: <1380223380-22451-1-git-send-email-grundler@chromium.org>

Don't replicate how the *error is returned by mmc_start_req().

Signed-off-by: Grant Grundler <grundler@chromium.org>
---
 drivers/mmc/core/core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 4d5de98..deb0ee5 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -538,13 +538,12 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
 	if (saved_areq) {
 		saved_err = mmc_wait_for_data_req_done(host, saved_areq->mrq,	areq);
 		if (saved_err == MMC_BLK_NEW_REQUEST) {
-			if (error)
-				*error = saved_err;
 			/*
 			 * The previous request was not completed,
 			 * nothing to return
 			 */
-			return NULL;
+			saved_areq = NULL;
+			goto set_error;
 		}
 		/*
 		 * Check BKOPS urgency for each R1 response
@@ -570,8 +569,10 @@ struct mmc_async_req *mmc_start_req(struct mmc_host *host,
 	if (saved_areq)
 		mmc_post_req(host, saved_areq->mrq, 0);
 
+set_error:
 	if (error)
 		*error = saved_err;
+
 	return saved_areq;
 }
 EXPORT_SYMBOL(mmc_start_req);
-- 
1.8.4


  parent reply	other threads:[~2013-09-26 19:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 19:22 [PATCH 0/7] mmc: core: cleanup and locking patches description Grant Grundler
2013-09-26 19:22 ` [PATCH 1/7] mmc: core: rename "data" to saved_areq Grant Grundler
2013-09-26 19:22 ` [PATCH 2/7] mmc: core: rename local var err to saved_err Grant Grundler
2013-09-26 19:22 ` [PATCH 3/7] mmc: core: restructure error handling for start req Grant Grundler
2013-09-26 19:22 ` Grant Grundler [this message]
2013-09-26 19:22 ` [PATCH 5/7] mmc: core: handling polling more gracefully Grant Grundler
2013-09-26 19:22 ` [PATCH 6/7] mmc: core: protect references to host->areq with host->lock Grant Grundler
2013-10-09  0:48   ` Grant Grundler
2013-10-09  9:07     ` Ulf Hansson
2013-09-26 19:23 ` [PATCH 7/7] mmc: core: mmc_start_req is a misnomer -> mmc_process_areq Grant Grundler
2013-09-26 19:57 ` [PATCH 0/7] mmc: core: cleanup and locking patches description Grant Grundler
2013-10-03 20:35   ` Grant Grundler
     [not found]     ` <CAPDyKFqZHkDAKoaRM1vrUXCMVsAZBEs-PanjyoR=E=Lrp1aU7Q@mail.gmail.com>
2013-10-03 23:48       ` Grant Grundler

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=1380223380-22451-5-git-send-email-grundler@chromium.org \
    --to=grundler@chromium.org \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    --cc=ulf.hansson@linaro.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).