Skip to content
Snippets Groups Projects
Commit 95efa79d authored by Michal Simek's avatar Michal Simek Committed by Wolfgang Denk
Browse files

net: xilinx emaclite: Fix return values


Fix return values for initialize/init/recv/send functions

Signed-off-by: default avatarMichal Simek <monstr@monstr.eu>
parent 0da43893
No related branches found
No related tags found
No related merge requests found
...@@ -226,7 +226,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) ...@@ -226,7 +226,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len)
out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET + out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET +
XEL_BUFFER_OFFSET, 0); XEL_BUFFER_OFFSET, 0);
#endif #endif
return 0; return -1;
} }
/* Determine the expected TX buffer address */ /* Determine the expected TX buffer address */
...@@ -252,7 +252,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) ...@@ -252,7 +252,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len)
reg |= XEL_TSR_XMIT_ACTIVE_MASK; reg |= XEL_TSR_XMIT_ACTIVE_MASK;
} }
out_be32 (baseaddress + XEL_TSR_OFFSET, reg); out_be32 (baseaddress + XEL_TSR_OFFSET, reg);
return 1; return 0;
} }
#ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG #ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG
/* Switch to second buffer */ /* Switch to second buffer */
...@@ -273,11 +273,11 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) ...@@ -273,11 +273,11 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len)
reg |= XEL_TSR_XMIT_ACTIVE_MASK; reg |= XEL_TSR_XMIT_ACTIVE_MASK;
} }
out_be32 (baseaddress + XEL_TSR_OFFSET, reg); out_be32 (baseaddress + XEL_TSR_OFFSET, reg);
return 1; return 0;
} }
#endif #endif
puts ("Error while sending frame\n"); puts ("Error while sending frame\n");
return 0; return -1;
} }
static int emaclite_recv(struct eth_device *dev) static int emaclite_recv(struct eth_device *dev)
...@@ -337,7 +337,7 @@ static int emaclite_recv(struct eth_device *dev) ...@@ -337,7 +337,7 @@ static int emaclite_recv(struct eth_device *dev)
debug ("Packet receive from 0x%x, length %dB\n", baseaddress, length); debug ("Packet receive from 0x%x, length %dB\n", baseaddress, length);
NetReceive ((uchar *) etherrxbuff, length); NetReceive ((uchar *) etherrxbuff, length);
return 1; return length;
} }
...@@ -347,7 +347,7 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) ...@@ -347,7 +347,7 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
dev = malloc(sizeof(*dev)); dev = malloc(sizeof(*dev));
if (dev == NULL) if (dev == NULL)
hang(); return -1;
memset(dev, 0, sizeof(*dev)); memset(dev, 0, sizeof(*dev));
sprintf(dev->name, "Xilinx_Emaclite"); sprintf(dev->name, "Xilinx_Emaclite");
...@@ -361,5 +361,5 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) ...@@ -361,5 +361,5 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr)
eth_register(dev); eth_register(dev);
return 0; return 1;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment