mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-24 12:44:23 +08: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
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user