From: Michal Simek Date: Tue, 8 Mar 2011 04:25:53 +0000 (+0000) Subject: net: xilinx emaclite: Fix return values X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=95efa79d089fabf9f5a56756ff3c32235ddebc37;p=u-boot.git net: xilinx emaclite: Fix return values Fix return values for initialize/init/recv/send functions Signed-off-by: Michal Simek --- diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 76af939e98..3c7c2501cb 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -226,7 +226,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) out_be32 (emaclite.baseaddress + XEL_TSR_OFFSET + XEL_BUFFER_OFFSET, 0); #endif - return 0; + return -1; } /* Determine the expected TX buffer address */ @@ -252,7 +252,7 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) reg |= XEL_TSR_XMIT_ACTIVE_MASK; } out_be32 (baseaddress + XEL_TSR_OFFSET, reg); - return 1; + return 0; } #ifdef CONFIG_XILINX_EMACLITE_TX_PING_PONG /* Switch to second buffer */ @@ -273,11 +273,11 @@ static int emaclite_send (struct eth_device *dev, volatile void *ptr, int len) reg |= XEL_TSR_XMIT_ACTIVE_MASK; } out_be32 (baseaddress + XEL_TSR_OFFSET, reg); - return 1; + return 0; } #endif puts ("Error while sending frame\n"); - return 0; + return -1; } 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); NetReceive ((uchar *) etherrxbuff, length); - return 1; + return length; } @@ -347,7 +347,7 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) dev = malloc(sizeof(*dev)); if (dev == NULL) - hang(); + return -1; memset(dev, 0, sizeof(*dev)); sprintf(dev->name, "Xilinx_Emaclite"); @@ -361,5 +361,5 @@ int xilinx_emaclite_initialize (bd_t *bis, int base_addr) eth_register(dev); - return 0; + return 1; }