From patchwork Fri Nov 2 17:18:32 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196663 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 7CE632C00C4 for ; Sat, 3 Nov 2012 04:27:21 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BC1F64A22D; Fri, 2 Nov 2012 18:23:14 +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 EWcttkzHfuos; Fri, 2 Nov 2012 18:23:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 571F64A230; Fri, 2 Nov 2012 18:20:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2F8244A1A3 for ; Fri, 2 Nov 2012 18:19:33 +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 D6+88y1+kxzy for ; Fri, 2 Nov 2012 18:19:31 +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 ECAC34A15E for ; Fri, 2 Nov 2012 18:19:06 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187551eek.3 for ; Fri, 02 Nov 2012 10:19:06 -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=/QMWmPI43S7MkU/mif5dJgVqzmCweDsiCiWmBt1Jm50=; b=oF12sh5cw3ARWw8XgpQ5/yLPHIyKarMDMaYJdl7DvAeHunQsQW9LlY1GuRMKt9AVDV h/OfQ7TmguUHB8UToqXCl1VnK1GBRRj4TFBXFSSnOoHAVxq2fl2IqfO3QiqpbmNiDoTn aj2GiMFbvdmHcaMKK9jMdKu+A/IP+o/1Cv7tjZJitUzN2qOQ2YykgwpODuRoC4ThbvMf 59hIRZt037PunuAHmCM+nCWamOn3i0y3K6RiSzTxUhcs7tmvjf7FJoN9v+mufhEV00Kx q5NQZmHt8KXuAKJTx5fB6XqfJiYNEpmoAh29iaoIlslywDM8vLFOid9xpWhf+iuXwtNh p/iw== Received: by 10.14.179.69 with SMTP id g45mr8667563eem.42.1351876746790; Fri, 02 Nov 2012 10:19:06 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id o49sm24522402eep.5.2012.11.02.10.19.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 560484635B7; 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:32 +0100 Message-Id: <1351876722-5183-41-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 40/50] net: rtl8169: 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/rtl8169.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/rtl8169.c b/drivers/net/rtl8169.c index c75fd4f..80f8443 100644 --- a/drivers/net/rtl8169.c +++ b/drivers/net/rtl8169.c @@ -872,6 +872,14 @@ static int rtl_init(struct eth_device *dev, bd_t *bis) return 1; } +static struct eth_ops rtl_ops = { + .init = rtl_reset, + .halt = rtl_halt, + .send = rtl_send, + .recv = rtl_recv +}; + + int rtl8169_initialize(bd_t *bis) { pci_dev_t devno; @@ -902,10 +910,7 @@ int rtl8169_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int)pci_mem_to_phys(devno, iobase); - dev->eo->init = rtl_reset; - dev->eo->halt = rtl_halt; - dev->eo->send = rtl_send; - dev->eo->recv = rtl_recv; + dev->eo = &rtl_ops; eth_register (dev);