[U-Boot] [PATCH 3/4] mmc: atmel: Implement proper private data

Andreas Bießmann andreas.devel at googlemail.com
Sat Oct 24 10:35:45 CEST 2015


Hi Marek,

On 24.10.15 01:29, Marek Vasut wrote:
> On Saturday, October 24, 2015 at 12:59:14 AM, Andreas Bießmann wrote:
>> On 23.10.15 20:46, Marek Vasut wrote:
>>> Instead of passing just the register area as a private data, introduce
>>> a proper struct atmel_mci_priv structure instead. This will become useful
>>> in the subsequent patch, where we eliminate the global variable from this
>>> driver.
>>>
>>> Signed-off-by: Marek Vasut <marex at denx.de>
>>
>> Reveiwed-by: Andreas Bießmann <andreas.devel at googlemail.com>
>>
>>> ---
>>>
>>>  drivers/mmc/gen_atmel_mci.c | 34 ++++++++++++++++++++++------------
>>>  1 file changed, 22 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/mmc/gen_atmel_mci.c b/drivers/mmc/gen_atmel_mci.c
>>> index 8b05fcd..abc77cc 100644
>>> --- a/drivers/mmc/gen_atmel_mci.c
>>> +++ b/drivers/mmc/gen_atmel_mci.c

>>> @@ -425,7 +435,7 @@ int atmel_mci_init(void *regs)
>>>
>>>  	cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
>>>
>>> -	mmc = mmc_create(cfg, regs);
>>> +	mmc = mmc_create(cfg, priv);
>>>
>>>  	if (mmc == NULL) {
>>>  	
>>>  		free(cfg);
>>
>> We shouldn't free cfg here but priv, the rest looks sane to me. Eventual
>> return -ENODEV on !mmc and adopt the following comment, we may leak priv
>> now as there is no de-init.
> 
> Uh right, can you fix that while applying the patchset or do you want me to 
> repost ?

I'll fix it.

Andreas


More information about the U-Boot mailing list