mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
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:
parent
a68aac4947
commit
88227a1d8a
1 changed files with 1 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue