mmc: fsl_esdhc: Use calloc()

A malloc() followed by memset() can be simply replaced by calloc().

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
This commit is contained in:
Fabio Estevam 2012-12-27 08:51:08 +00:00 committed by Andy Fleming
parent a68aac4947
commit 88227a1d8a

View File

@ -601,8 +601,7 @@ int fsl_esdhc_mmc_init(bd_t *bis)
{ {
struct fsl_esdhc_cfg *cfg; struct fsl_esdhc_cfg *cfg;
cfg = malloc(sizeof(struct fsl_esdhc_cfg)); cfg = calloc(sizeof(struct fsl_esdhc_cfg), 1);
memset(cfg, 0, sizeof(struct fsl_esdhc_cfg));
cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR; cfg->esdhc_base = CONFIG_SYS_FSL_ESDHC_ADDR;
cfg->sdhc_clk = gd->arch.sdhc_clk; cfg->sdhc_clk = gd->arch.sdhc_clk;
return fsl_esdhc_initialize(bis, cfg); return fsl_esdhc_initialize(bis, cfg);