From: Michal Simek Date: Thu, 25 Aug 2011 10:28:47 +0000 (+0200) Subject: net: emaclite: Use calloc instead of malloc X-Git-Tag: v2011.12-rc1~602^2~2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=28ae02e5af9f38886860b883dcff22c4354667e5;p=u-boot net: emaclite: Use calloc instead of malloc Simplify driver logic and clear eth_device structure in one command. Signed-off-by: Michal Simek --- diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 2a5c5e16f5..28aab972b8 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -344,11 +344,10 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) { struct eth_device *dev; - dev = malloc(sizeof(*dev)); + dev = calloc(1, sizeof(*dev)); if (dev == NULL) return -1; - memset(dev, 0, sizeof(*dev)); sprintf(dev->name, "Xelite.%x", base_addr); dev->iobase = base_addr;