diff options
author | Michal Simek <monstr@monstr.eu> | 2011-03-08 04:25:53 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2011-05-12 22:29:28 +0200 |
commit | 95efa79d089fabf9f5a56756ff3c32235ddebc37 (patch) | |
tree | 4a654cdeb32c0a3a6dbafd8f061aaa25458102d2 | |
parent | 0da43893dda8be14b18b2b12dcc48a5e356a742e (diff) | |
download | u-boot-imx-95efa79d089fabf9f5a56756ff3c32235ddebc37.zip u-boot-imx-95efa79d089fabf9f5a56756ff3c32235ddebc37.tar.gz u-boot-imx-95efa79d089fabf9f5a56756ff3c32235ddebc37.tar.bz2 |
net: xilinx emaclite: Fix return values
Fix return values for initialize/init/recv/send functions
Signed-off-by: Michal Simek <monstr@monstr.eu>
-rw-r--r-- | drivers/net/xilinx_emaclite.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index 76af939..3c7c250 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; } |