projects
/
platform
/
kernel
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a68aac4
)
mmc: fsl_esdhc: Use calloc()
author
Fabio Estevam
<fabio.estevam@freescale.com>
Thu, 27 Dec 2012 08:51:08 +0000
(08:51 +0000)
committer
Andy Fleming
<afleming@freescale.com>
Mon, 6 May 2013 21:26:25 +0000
(16:26 -0500)
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>
drivers/mmc/fsl_esdhc.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/fsl_esdhc.c
b/drivers/mmc/fsl_esdhc.c
index e945c0a470ca85667026a422933e7669effcb6a2..ec01795f32c1bd47545461ca0bedce729d75d7f2 100644
(file)
--- 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);