mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-12 03:58:47 +01:00
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>
This commit is contained in:
parent
be98696741
commit
28ae02e5af
1 changed files with 1 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue