From patchwork Wed Nov 21 13:23:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200701 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 DC8D02C0089 for ; Thu, 22 Nov 2012 00:27:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A6BC24A09C; Wed, 21 Nov 2012 14:27: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 0oYCawmaXTF6; Wed, 21 Nov 2012 14:27:08 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81B694A0FA; Wed, 21 Nov 2012 14:25:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3EA154A0C1 for ; Wed, 21 Nov 2012 14:24:50 +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 Xq72cIsEnyO3 for ; Wed, 21 Nov 2012 14:24:49 +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 656F74A02F for ; Wed, 21 Nov 2012 14:24:27 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id a1so2241673eaa.3 for ; Wed, 21 Nov 2012 05:24:27 -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=pC/l/lOQvlr6U5MLwE0Ot8x/SyXKB5bWVFmw1CIfhhQ=; b=FbFRSHmslbIPzqyrd7Accu5tcq+3jBo0pLwO7BiizJBMO00osZH1J3YnugiBFOs2cz C+OqsqMmNPjcvDzteLDW8mwJd4/+8wnFo1IbD6siUuMA1H0Glx0hBNxqxSRlsy9G7fxC CT14tSqUAoe9kUiBEnZAHjucBLxWnLASsar1GdUc+b4ogGN9jMNV0/6aB5eZWZiEcogr mkCIGdj4S5SIgkIzVCjY7a6Zlq5oT9zlqInLqhBPdgSI1eQJzxI0hWRFxss/4JgiSjmM CQluWeh+RapIpUSv4PO36SGAZzRDoxPTQ88NLZkQ+C1oBGiZqD85P3zPON3dDQ6n2BMY 5s+w== Received: by 10.14.194.136 with SMTP id m8mr45423143een.10.1353504267296; Wed, 21 Nov 2012 05:24:27 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id q2sm169063eem.13.2012.11.21.05.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:26 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 8DB7C46364C; Wed, 21 Nov 2012 14:24:20 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:04 +0100 Message-Id: <1353504238-11277-14-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 13/67] net: designware: 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/designware.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 2d92591..255819e 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -523,6 +523,14 @@ static int dw_mii_write(const char *devname, u8 addr, u8 reg, u16 val) } #endif +static struct eth_ops dw_eth_ops = { + .init = dw_eth_init, + .send = dw_eth_send, + .recv = dw_eth_recv, + .halt = dw_eth_halt, + .write_hwaddr = dw_write_hwaddr +}; + int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) { struct eth_device *dev; @@ -559,11 +567,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface) priv->phy_configured = 0; priv->interface = interface; - dev->eo->init = dw_eth_init; - dev->eo->send = dw_eth_send; - dev->eo->recv = dw_eth_recv; - dev->eo->halt = dw_eth_halt; - dev->eo->write_hwaddr = dw_write_hwaddr; + dev->eo = &dw_eth_ops; eth_register(dev);