projects
/
oweals
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
be98696
)
net: emaclite: Use calloc instead of malloc
author
Michal Simek
<monstr@monstr.eu>
Thu, 25 Aug 2011 10:28:47 +0000
(12:28 +0200)
committer
Michal Simek
<monstr@monstr.eu>
Mon, 3 Oct 2011 06:04:14 +0000
(08:04 +0200)
Simplify driver logic and clear eth_device structure
in one command.
Signed-off-by: Michal Simek <monstr@monstr.eu>
drivers/net/xilinx_emaclite.c
patch
|
blob
|
history
diff --git
a/drivers/net/xilinx_emaclite.c
b/drivers/net/xilinx_emaclite.c
index 2a5c5e16f584c893b9d398a438cce34d788298d7..28aab972b8154b17db9d5b64fc9eb7a16adc7fdc 100644
(file)
--- 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;