From patchwork Wed Nov 21 13:22:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200690 X-Patchwork-Delegate: joe.hershberger@gmail.com 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 F30B92C007E for ; Thu, 22 Nov 2012 00:25:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9DD294A039; Wed, 21 Nov 2012 14:25:35 +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 yFxQIc7TfAxN; Wed, 21 Nov 2012 14:25:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id ABE024A040; Wed, 21 Nov 2012 14:24:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EFB1C4A050 for ; Wed, 21 Nov 2012 14:24:34 +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 ugJ9ceHf3xAM for ; Wed, 21 Nov 2012 14:24:34 +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-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id 099204A03C for ; Wed, 21 Nov 2012 14:24:23 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id a1so2241673eaa.3 for ; Wed, 21 Nov 2012 05:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=91xfN5sK86HKPqfBV4xeT4hTgra1KQJR0g6i/jS0veQ=; b=BTRsGUKB07ge27aE900cNhp9L/cfE8aMenQEt/ZATs4huyOAsH25FgKOc4cfpcNOzG T53hAsLeO0C6hZEh23tuaVjPWn2a4SHDjKdpfQLJ7lmlBL689Tnguqh14rO8b6/KI2j6 gx0cCYpbZYM24GoLAA5zN4up2gFDNHL7DOe2jIvlqppw83PZhSiyZ+x8IZqigoHEAh2h o81KA4JHH0xRQKGQUXqOrN93z2OrJ2UceH5HlhEIZdwG43siDrtX8ddtplrIVHUkqpSt kFbturA8Hh9HzjPGI9rxH3XVsUvcu7aFMW4atLBzSW/InG+DXSxgcE4O+3o1ijhWcVoW Da2A== Received: by 10.14.214.133 with SMTP id c5mr45335619eep.8.1353504263287; Wed, 21 Nov 2012 05:24:23 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id f2sm222245eep.2.2012.11.21.05.24.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:22 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 47EBB462D57; Wed, 21 Nov 2012 14:24:20 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:22:55 +0100 Message-Id: <1353504238-11277-5-git-send-email-tmshlvck@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1353504238-11277-1-git-send-email-tmshlvck@gmail.com> References: <1351876722-5183-1-git-send-email-tmshlvck@gmail.com> <1353504238-11277-1-git-send-email-tmshlvck@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [PATCH v2 04/67] net: dm9000x: Pull out init of struct eth_ops X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Add static struct eth_ops and set ops function pointers statically. Remove setting eth_ops members dynamically. This is a step toward converting the driver for DM. Signed-off-by: Tomas Hlavacek --- drivers/net/dm9000x.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dm9000x.c b/drivers/net/dm9000x.c index bd96948..f6b226c 100644 --- a/drivers/net/dm9000x.c +++ b/drivers/net/dm9000x.c @@ -623,6 +623,13 @@ dm9000_phy_write(int reg, u16 value) DM9000_DBG("dm9000_phy_write(reg:0x%x, value:0x%x)\n", reg, value); } +static struct eth_ops dm9000_ops = { + .init = dm9000_init, + .send = dm9000_send, + .recv = dm9000_rx, + .halt = dm9000_halt +}; + int dm9000_initialize(bd_t *bis) { struct eth_device *dev = &(dm9000_info.netdev); @@ -630,10 +637,7 @@ int dm9000_initialize(bd_t *bis) /* Load MAC address from EEPROM */ dm9000_get_enetaddr(dev); - dev->eo->init = dm9000_init; - dev->eo->halt = dm9000_halt; - dev->eo->send = dm9000_send; - dev->eo->recv = dm9000_rx; + dev->eo = &dm9000_ops; sprintf(dev->name, "dm9000"); eth_register(dev);