diff mbox

[U-Boot] mmc: postponed needless timer initialization

Message ID 1398791805-23744-2-git-send-email-m.zalega@samsung.com
State Superseded
Delegated to: Pantelis Antoniou
Headers show

Commit Message

Mateusz Zalega April 29, 2014, 5:16 p.m. UTC
mmc_init() doesn't call get_timer() anymore if MMC is already
initialized.

Change-Id: Iec694abe3315d146d35dc130ad80b73dffd0983b
Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
---
Detached from earlier "DFU, MMC, Gadget, Goni, misc." series because of lack
of relevance to other patches.

There were no changes since the first version of this patch.
---
 drivers/mmc/mmc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Pantelis Antoniou April 29, 2014, 5:25 p.m. UTC | #1
Hi Mateusz,

Looks good. I'll apply it.

On Apr 29, 2014, at 8:16 PM, Mateusz Zalega wrote:

> mmc_init() doesn't call get_timer() anymore if MMC is already
> initialized.
> 
> Change-Id: Iec694abe3315d146d35dc130ad80b73dffd0983b
> Signed-off-by: Mateusz Zalega <m.zalega@samsung.com>
> Cc: Pantelis Antoniou <panto@antoniou-consulting.com>
> ---
> Detached from earlier "DFU, MMC, Gadget, Goni, misc." series because of lack
> of relevance to other patches.
> 
> There were no changes since the first version of this patch.
> ---
> 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 16051e5..c93dc24 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -1310,15 +1310,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
>
diff mbox

Patch

diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 16051e5..c93dc24 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1310,15 +1310,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;
 }