summaryrefslogtreecommitdiff
path: root/drivers/net/xilinx_emaclite.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2011-08-25 12:28:47 +0200
committerMichal Simek <monstr@monstr.eu>2011-10-03 08:04:14 +0200
commit28ae02e5af9f38886860b883dcff22c4354667e5 (patch)
tree4b788c71411cdab0471ebbb647fb66c6fbe3ad19 /drivers/net/xilinx_emaclite.c
parentbe986967419ffdd9528e5d53271a5c2220c1d878 (diff)
downloadu-boot-imx-28ae02e5af9f38886860b883dcff22c4354667e5.zip
u-boot-imx-28ae02e5af9f38886860b883dcff22c4354667e5.tar.gz
u-boot-imx-28ae02e5af9f38886860b883dcff22c4354667e5.tar.bz2
net: emaclite: Use calloc instead of malloc
Simplify driver logic and clear eth_device structure in one command. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'drivers/net/xilinx_emaclite.c')
-rw-r--r--drivers/net/xilinx_emaclite.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 2a5c5e1..28aab97 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;