All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] cmd_mmc: Use init_mmc_device() from do_mmc_rescan()
Date: Fri, 23 May 2014 13:24:46 -0600	[thread overview]
Message-ID: <1400873087-20921-2-git-send-email-swarren@wwwdotorg.org> (raw)
In-Reply-To: <1400873087-20921-1-git-send-email-swarren@wwwdotorg.org>

From: Stephen Warren <swarren@nvidia.com>

The body of init_mmc_device() is now identical to that of do_mmc_rescan()
except for the error codes returned. Modify do_mmc_rescan() to simply
call init_mmc_device() and convert the error codes, to avoid code
duplication.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 common/cmd_mmc.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 6741ebee3bca..6c8db2e78c4f 100644
--- a/common/cmd_mmc.c
+++ b/common/cmd_mmc.c
@@ -371,16 +371,10 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
 {
 	struct mmc *mmc;
 
-	mmc = find_mmc_device(curr_device);
-	if (!mmc) {
-		printf("no mmc device at slot %x\n", curr_device);
+	mmc = init_mmc_device(curr_device, true);
+	if (!mmc)
 		return CMD_RET_FAILURE;
-	}
-
-	mmc->has_init = 0;
 
-	if (mmc_init(mmc))
-		return CMD_RET_FAILURE;
 	return CMD_RET_SUCCESS;
 }
 static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
-- 
1.8.1.5

  reply	other threads:[~2014-05-23 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 19:24 [U-Boot] [PATCH 1/3] cmd_mmc: add force_init parameter to init_mmc_device() Stephen Warren
2014-05-23 19:24 ` Stephen Warren [this message]
2014-06-12 11:29   ` [U-Boot] [PATCH 2/3] cmd_mmc: Use init_mmc_device() from do_mmc_rescan() Pantelis Antoniou
2014-05-23 19:24 ` [U-Boot] [PATCH 3/3] cmd_mmc: make mmc dev always re-probe the HW Stephen Warren
2014-06-12 11:31   ` Pantelis Antoniou
2014-06-12 16:19     ` Stephen Warren
2014-06-12 16:24       ` Pantelis Antoniou
2014-05-30 21:12 ` [U-Boot] [PATCH 1/3] cmd_mmc: add force_init parameter to init_mmc_device() Stephen Warren
2014-06-02  4:59   ` Jaehoon Chung
2014-06-02 15:50     ` Stephen Warren
2014-06-10 16:01   ` Stephen Warren
2014-06-12 11:28 ` Pantelis Antoniou

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=1400873087-20921-2-git-send-email-swarren@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.