From patchwork Tue Oct 19 05:03:46 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nobuhiro Iwamatsu X-Patchwork-Id: 71880 Return-Path: X-Original-To: wd@gemini.denx.de Delivered-To: wd@gemini.denx.de Received: from diddl.denx.de (diddl.denx.de [10.0.0.6]) by gemini.denx.de (Postfix) with ESMTP id 21331136320 for ; Tue, 19 Oct 2010 07:03:17 +0200 (CEST) Received: from diddl.denx.de (localhost.localdomain [127.0.0.1]) by diddl.denx.de (Postfix) with ESMTP id 0B322348C9D2 for ; Tue, 19 Oct 2010 07:03:17 +0200 (CEST) Received: from pop.mnet-online.de by diddl.denx.de with POP3 (fetchmail-6.3.17) for (single-drop); Tue, 19 Oct 2010 07:03:17 +0200 (CEST) Received: from murder ([192.168.8.180]) by backend2 (Cyrus v2.2.12) with LMTPA; Tue, 19 Oct 2010 07:01:57 +0200 X-Sieve: CMU Sieve 2.2 Received: from mail.m-online.net (localhost [127.0.0.1]) by frontend1.mail.m-online.net (Cyrus v2.2.12) with LMTPA; Tue, 19 Oct 2010 07:01:56 +0200 Received: from scanner-3.m-online.net (unknown [192.168.6.168]) by mail.m-online.net (Postfix) with ESMTP id A97121C001B3; Tue, 19 Oct 2010 07:01:56 +0200 (CEST) Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by mxin-1.m-online.net (Postfix) with ESMTP id 4620E46C0A6; Tue, 19 Oct 2010 07:01:55 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C0A192815F; Tue, 19 Oct 2010 07:01:00 +0200 (CEST) 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 hL2R-3jc7Vya; Tue, 19 Oct 2010 07:01:00 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 94C8928102; Tue, 19 Oct 2010 07:00:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 02212280A2 for ; Tue, 19 Oct 2010 07:00:12 +0200 (CEST) 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 yZfjrdT1sQjH for ; Tue, 19 Oct 2010 07:00:11 +0200 (CEST) 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-pw0-f44.google.com (mail-pw0-f44.google.com [209.85.160.44]) by theia.denx.de (Postfix) with ESMTP id 645F628080 for ; Tue, 19 Oct 2010 07:00:07 +0200 (CEST) Received: by mail-pw0-f44.google.com with SMTP id 8so387518pwj.3 for ; Mon, 18 Oct 2010 22:00:07 -0700 (PDT) Received: by 10.142.162.15 with SMTP id k15mr4219875wfe.354.1287464407046; Mon, 18 Oct 2010 22:00:07 -0700 (PDT) Received: from chimagu (49.14.32.202.bf.2iij.net [202.32.14.49]) by mx.google.com with ESMTPS id v19sm22628566wfh.12.2010.10.18.22.00.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 18 Oct 2010 22:00:06 -0700 (PDT) Received: from iwamatsu by chimagu with local (Exim 4.72) (envelope-from ) id 1P84Md-0003DK-JC; Tue, 19 Oct 2010 14:03:55 +0900 From: Nobuhiro Iwamatsu To: u-boot@lists.denx.de Date: Tue, 19 Oct 2010 14:03:46 +0900 Message-Id: <1287464627-12302-9-git-send-email-iwamatsu@nigauri.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1287464627-12302-1-git-send-email-iwamatsu@nigauri.org> References: <1287464627-12302-1-git-send-email-iwamatsu@nigauri.org> Cc: biggerbadderben@gmail.com Subject: [U-Boot] [PATCH 09/10 v2] net: tsi108_eth: Add initialized eth_device structure 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 X-Virus-Scanned: by amavisd-new at m-online.net tsi108_eth driver does not have write_hwaddr function. However, eth stuff executes write_hwaddr function because eth_device structure has not been initialized. Signed-off-by: Nobuhiro Iwamatsu CC: Ben Warren --- drivers/net/tsi108_eth.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c index 079354a..f100ec1 100644 --- a/drivers/net/tsi108_eth.c +++ b/drivers/net/tsi108_eth.c @@ -731,7 +731,11 @@ int tsi108_eth_initialize (bd_t * bis) for (index = 0; index < CONFIG_TSI108_ETH_NUM_PORTS; index++) { dev = (struct eth_device *)malloc(sizeof(struct eth_device)); - + if (!dev) { + printf("tsi108: Can not allocate memory\n"); + break; + } + memset(dev, 0, sizeof(*dev)); sprintf (dev->name, "TSI108_eth%d", index); dev->iobase = ETH_BASE + (index * ETH_PORT_OFFSET);