diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2012-12-27 08:51:08 +0000 |
---|---|---|
committer | Andy Fleming <afleming@freescale.com> | 2013-05-06 16:26:25 -0500 |
commit | 88227a1d8a734cfd09ac43609abec8b66c2d2610 (patch) | |
tree | e06d814ed5decb813a61d2a003c8a89722bfc497 /drivers/mmc/fsl_esdhc.c | |
parent | a68aac4947bf8dfd429267561ddf438fab2561ec (diff) | |
download | u-boot-imx-88227a1d8a734cfd09ac43609abec8b66c2d2610.zip u-boot-imx-88227a1d8a734cfd09ac43609abec8b66c2d2610.tar.gz u-boot-imx-88227a1d8a734cfd09ac43609abec8b66c2d2610.tar.bz2 |
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>
Diffstat (limited to 'drivers/mmc/fsl_esdhc.c')
-rw-r--r-- | drivers/mmc/fsl_esdhc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index e945c0a..ec01795 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); |