From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sat, 24 Oct 2015 14:52:43 +0200 Subject: [U-Boot] [PATCH 3/4] mmc: atmel: Implement proper private data In-Reply-To: <562B42E1.5030905@googlemail.com> References: <1445625991-5343-1-git-send-email-marex@denx.de> <201510240129.00916.marex@denx.de> <562B42E1.5030905@googlemail.com> Message-ID: <201510241452.43528.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Saturday, October 24, 2015 at 10:35:45 AM, Andreas Bie?mann wrote: > Hi Marek, Hi! > 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 > >> > >> Reveiwed-by: Andreas Bie?mann > >> > >>> --- > >>> > >>> 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. Thanks! Best regards, Marek Vasut