From patchwork Tue Mar 8 14:25:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 86017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 8FEEAB6EEB for ; Wed, 9 Mar 2011 01:26:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 463B42812B; Tue, 8 Mar 2011 15:26:10 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id E-tDAL4SS8Dk; Tue, 8 Mar 2011 15:26:10 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 98460280F3; Tue, 8 Mar 2011 15:26:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C5067280ED for ; Tue, 8 Mar 2011 15:25:59 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hRYVaZTQCuaO for ; Tue, 8 Mar 2011 15:25:58 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTPS id 5226C280EC for ; Tue, 8 Mar 2011 15:25:58 +0100 (CET) Received: by mail-fx0-f44.google.com with SMTP id 15so5075442fxm.3 for ; Tue, 08 Mar 2011 06:25:58 -0800 (PST) Received: by 10.223.6.220 with SMTP id a28mr4781166faa.94.1299594358170; Tue, 08 Mar 2011 06:25:58 -0800 (PST) Received: from localhost ([178.23.216.97]) by mx.google.com with ESMTPS id f24sm354066fak.0.2011.03.08.06.25.56 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Mar 2011 06:25:57 -0800 (PST) From: Michal Simek To: u-boot@lists.denx.de Date: Tue, 8 Mar 2011 15:25:53 +0100 Message-Id: <1299594353-15887-2-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.5.5.1 In-Reply-To: <1299594353-15887-1-git-send-email-monstr@monstr.eu> References: <1299594353-15887-1-git-send-email-monstr@monstr.eu> Subject: [U-Boot] [PATCH 2/2] net: xilinx emaclite: Fix return values X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Fix return values for initialize/init/recv/send functions Signed-off-by: Michal Simek --- 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; }