From patchwork Fri Nov 2 17:18:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196671 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 80DEE2C00C8 for ; Sat, 3 Nov 2012 04:29:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C1DD04A8FF; Fri, 2 Nov 2012 18:25:39 +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 PfXcgtpviDgh; Fri, 2 Nov 2012 18:25:39 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC6964A853; Fri, 2 Nov 2012 18:25:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3EF6F4A82D for ; Fri, 2 Nov 2012 18:25:08 +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 2NoiCyx7+py8 for ; Fri, 2 Nov 2012 18:25:06 +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-ee0-f44.google.com (mail-ee0-f44.google.com [74.125.83.44]) by theia.denx.de (Postfix) with ESMTPS id 36D294A822 for ; Fri, 2 Nov 2012 18:25:04 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2190476eek.3 for ; Fri, 02 Nov 2012 10:25:04 -0700 (PDT) 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=NKUI3GeC+LUVeVGDdkN5v/Cr5QLbU+SzuiBKUGBxJXI=; b=gR+yNQ9jOBSzbGbm6yFTIDVVuXKnYzxdXuKcUie/uD176VJhcytnP5BlvOKq1YsqoD Mpe9M3SpkJF0Y8CPAerf71uYrv5ovJ60vHis2rUI8cu6yE6aXJPLc5e/ku+NcU7/t0zf HOh/3h8LQ1/uGugxEZMddkQMNd2Ywqeg7imxxnYQu+HImwjZuf4M0Zc5liLSWBnUIsTY ewTozDVx+5iKKMmHYYXJM2f7eFCvDW6T/3VHhInRC9VxJy36YdKnJKHWvNYPfmy1srip FhCrQLEUOOJsau4u2K6xw4YkswUSs2ROauOhbxULTI48afTwUqZ817wOKEaMZrUytb9y JW3A== Received: by 10.14.0.198 with SMTP id 46mr8901115eeb.21.1351877104747; Fri, 02 Nov 2012 10:25:04 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id e1sm24568712eem.3.2012.11.02.10.25.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:25:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 811114635D4; Fri, 2 Nov 2012 18:18:55 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:18:38 +0100 Message-Id: <1351876722-5183-47-git-send-email-tmshlvck@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1351876722-5183-1-git-send-email-tmshlvck@gmail.com> References: <1351876722-5183-1-git-send-email-tmshlvck@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [RFC PATCH 46/50] net: xilinx_axi_emac: 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/xilinx_axi_emac.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/xilinx_axi_emac.c b/drivers/net/xilinx_axi_emac.c index 54a871b..44ece48 100644 --- a/drivers/net/xilinx_axi_emac.c +++ b/drivers/net/xilinx_axi_emac.c @@ -622,6 +622,15 @@ static int axiemac_bus_reset(struct mii_dev *bus) return 0; } +static struct eth_ops axiemac_ops = { + .init = axiemac_init, + .halt = axiemac_halt, + .send = axiemac_send, + .recv = axiemac_recv, + .write_hwaddr = axiemac_setup_mac +}; + + int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, unsigned long dma_addr) { @@ -645,11 +654,7 @@ int xilinx_axiemac_initialize(bd_t *bis, unsigned long base_addr, priv->dmatx = (struct axidma_reg *)dma_addr; /* RX channel offset is 0x30 */ priv->dmarx = (struct axidma_reg *)(dma_addr + 0x30); - dev->eo->init = axiemac_init; - dev->eo->halt = axiemac_halt; - dev->eo->send = axiemac_send; - dev->eo->recv = axiemac_recv; - dev->eo->write_hwaddr = axiemac_setup_mac; + dev->eo = &axiemac_ops; #ifdef CONFIG_PHY_ADDR priv->phyaddr = CONFIG_PHY_ADDR;