summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorStephen Warren <swarren@nvidia.com>2014-05-23 13:24:46 -0600
committerPantelis Antoniou <panto@antoniou-consulting.com>2014-06-12 15:21:12 +0300
commit941944e445193a07dea77787680666db049a14dc (patch)
treea6828c04d1d7bd7715d47ac4fac822863ad21e93 /common
parent1ae24a5041b6fab7cc986bda7fec92b3d643ac96 (diff)
downloadu-boot-imx-941944e445193a07dea77787680666db049a14dc.zip
u-boot-imx-941944e445193a07dea77787680666db049a14dc.tar.gz
u-boot-imx-941944e445193a07dea77787680666db049a14dc.tar.bz2
cmd_mmc: Use init_mmc_device() from do_mmc_rescan()
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> Acked-by: Pantelis Antoniou <panto@antoniou-consulting.com>
Diffstat (limited to 'common')
-rw-r--r--common/cmd_mmc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c
index 6741ebe..6c8db2e 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,