From: Fabio Estevam Date: Thu, 27 Dec 2012 08:51:08 +0000 (+0000) Subject: mmc: fsl_esdhc: Use calloc() X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=88227a1d8a734cfd09ac43609abec8b66c2d2610;p=u-boot.git mmc: fsl_esdhc: Use calloc() A malloc() followed by memset() can be simply replaced by calloc(). Signed-off-by: Fabio Estevam Signed-off-by: Andy Fleming --- diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index e945c0a470..ec01795f32 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -601,8 +601,7 @@ int fsl_esdhc_mmc_init(bd_t *bis) { struct fsl_esdhc_cfg *cfg; - cfg = malloc(sizeof(struct fsl_esdhc_cfg)); - memset(cfg, 0, sizeof(struct fsl_esdhc_cfg)); + cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1); cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR; cfg->sdhc_clk = gd->arch.sdhc_clk; return fsl_esdhc_initialize(bis, cfg);