[U-Boot] [PATCH v2] mmc: postponed needless timer initialization

Pantelis Antoniou panto at antoniou-consulting.com
Fri May 23 10:21:20 CEST 2014


Hi Mateusz,

On Apr 29, 2014, at 9:15 PM, Mateusz Zalega wrote:

> mmc_init() doesn't call get_timer() anymore if MMC is already
> initialized.
> 
> Signed-off-by: Mateusz Zalega <m.zalega at samsung.com>
> Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
> ---
> Detached from earlier "DFU, MMC, Gadget, Goni, misc." series because of lack
> of relevance to other patches.
> 
> v2:
> - deleted change-id line from commit message, sorry!
> ---
> 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);
> +

^ some extra formatting here that's not needed; I'll fix it and apply.

I am curious what the problem was the problem with getting the timer?

> 	debug("%s: %d, time %lu\n", __func__, err, get_timer(start));
> 	return err;
> }
> -- 
> 1.9.0
> 

Applied

Thanks

-- Pantelis

Acked-by: Pantelis Antoniou <panto at antoniou-consulting.com>




More information about the U-Boot mailing list