[U-Boot] [PATCH v3 11/13] mmc: postponed needless timer initialization
Mateusz Zalega
m.zalega at samsung.com
Mon Mar 31 17:49:10 CEST 2014
mmc_init() doesn't call get_timer() anymore if MMC is already
initialized.
Change-Id: Ib4e0f5a04316c604e6a77a0679d42ff61d5641d2
Signed-off-by: Mateusz Zalega <m.zalega at samsung.com>
---
drivers/mmc/mmc.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 8ab0bc9..9da31f5 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1279,15 +1279,18 @@ static int mmc_complete_init(struct mmc *mmc)
int mmc_init(struct mmc *mmc)
{
int err = IN_PROGRESS;
- unsigned start = get_timer(0);
+ unsigned start;
if (mmc->has_init)
return 0;
+
+ start = get_timer(0);
+
if (!mmc->init_in_progress)
err = mmc_start_init(mmc);
-
if (!err || err == IN_PROGRESS)
err = mmc_complete_init(mmc);
+
debug("%s: %d, time %lu\n", __func__, err, get_timer(start));
return err;
}
--
1.9.0
More information about the U-Boot
mailing list