From patchwork Wed Nov 21 13:23:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200752 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 1E8A12C007E for ; Thu, 22 Nov 2012 00:35:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0FA8E4A0A9; Wed, 21 Nov 2012 14:35:29 +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 lGzp31oRuGIH; Wed, 21 Nov 2012 14:35:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 860B94A260; Wed, 21 Nov 2012 14:34:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2E2CD4A0F0 for ; Wed, 21 Nov 2012 14:32:40 +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 S4Z4W43GcEpw for ; Wed, 21 Nov 2012 14:32:36 +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 8B68F4A100 for ; Wed, 21 Nov 2012 14:32:14 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id a1so2244488eaa.3 for ; Wed, 21 Nov 2012 05:32:14 -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=p9FWpvefaH2nigXvenUv+r8zxAGaZXczkTyt4Qsqoqs=; b=GiMhvebVKZjzqFGbVB1d32zkZGjTBCAvk74KX5ZgfNE9fLxiZTk3uamudhtGX8pTV3 pJQisiwVutOBJ7OWDtp54Jot/9hMdvuiSCmAyIdmxF5t2HrrXWtEd/2MhwGatQnbpZvJ h+9XYZIUaET7LuXbpJdBqa8sBigP5zHG5Z9nx+54F4ct6A2P35r2A/45As4vhaZiUFCY igbTLeTcZKYyaDX1URDt0L+tTm20mYsi/znEZr67p8nrZT10mNWocpResVtkiiovA2Fn qMtfWMLoF84lFWvlkgpuC0xHU5ntaQHYjWysRcAeGCXNP9rxuvSbArROzse3offuY8vT Zt5Q== Received: by 10.14.221.194 with SMTP id r42mr45640280eep.25.1353504734027; Wed, 21 Nov 2012 05:32:14 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id e1sm257408eem.3.2012.11.21.05.32.11 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:32:12 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 9347C4637D7; Wed, 21 Nov 2012 14:24:21 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:39 +0100 Message-Id: <1353504238-11277-49-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 48/67] net: xilinx_ll_temac: 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_ll_temac.c | 27 ++++++++++++++++++++------- 1 files changed, 20 insertions(+), 7 deletions(-) diff --git a/drivers/net/xilinx_ll_temac.c b/drivers/net/xilinx_ll_temac.c index 8f67417..5f52251 100644 --- a/drivers/net/xilinx_ll_temac.c +++ b/drivers/net/xilinx_ll_temac.c @@ -282,6 +282,24 @@ static int ll_temac_phy_init(struct eth_device *dev) return 1; } +static struct eth_ops ll_temac_ops_sdma = { + .init = ll_temac_init, + .halt = ll_temac_halt, + .write_hwaddr = ll_temac_setup_mac_addr, + .recv = ll_temac_recv_sdma, + .send = ll_temac_send_sdma +}; + +static struct eth_ops ll_temac_ops_fifo = { + .init = ll_temac_init, + .halt = ll_temac_halt, + .write_hwaddr = ll_temac_setup_mac_addr, + .recv = ll_temac_recv_fifo, + .send = ll_temac_send_fifo +}; + + + /* * Initialize a single ll_temac devices * @@ -313,9 +331,6 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) dev->iobase = devinf->base_addr; dev->priv = ll_temac; - dev->eo->init = ll_temac_init; - dev->eo->halt = ll_temac_halt; - dev->eo->write_hwaddr = ll_temac_setup_mac_addr; ll_temac->ctrladdr = devinf->ctrl_addr; if (devinf->flags & XILINX_LL_TEMAC_M_SDMA_PLB) { @@ -334,16 +349,14 @@ int xilinx_ll_temac_initialize(bd_t *bis, struct ll_temac_info *devinf) ll_temac->ctrlinit = ll_temac_init_sdma; ll_temac->ctrlhalt = ll_temac_halt_sdma; ll_temac->ctrlreset = ll_temac_reset_sdma; - dev->eo->recv = ll_temac_recv_sdma; - dev->eo->send = ll_temac_send_sdma; + dev->eo = &ll_temac_ops_sdma; } else { ll_temac->in32 = NULL; ll_temac->out32 = NULL; ll_temac->ctrlinit = NULL; ll_temac->ctrlhalt = NULL; ll_temac->ctrlreset = ll_temac_reset_fifo; - dev->eo->recv = ll_temac_recv_fifo; - dev->eo->send = ll_temac_send_fifo; + dev->eo = &ll_temac_ops_fifo; } /* Link to specified MDIO bus */