From patchwork Fri Nov 2 17:18:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196660 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 975EE2C00B0 for ; Sat, 3 Nov 2012 04:26:16 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8E07C4A64B; Fri, 2 Nov 2012 18:22: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 jxPOHLOpI1ck; Fri, 2 Nov 2012 18:22:50 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CDEC54A1FE; Fri, 2 Nov 2012 18:19:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D28F4A11F for ; Fri, 2 Nov 2012 18:19: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 jkDmJ+KJmEu9 for ; Fri, 2 Nov 2012 18:19:27 +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 6CED24A167 for ; Fri, 2 Nov 2012 18:19:05 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625261eaa.3 for ; Fri, 02 Nov 2012 10:19:05 -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=Nik/szg6M68xkzXGDaVuuFd/9Q3n6a9vsZ+bNMNc/eU=; b=ofAdunH8zwanuy22HGlP6/MCHPMRjYE5mguz2Fr6ljp36nBCDnyzFjCbz389zLQkBY IACeFB+YmPnm9eN5UgO7X5FY/D1RoR/PVx0Wg2eALjUC73KPYACkJMoxx3Gk0kIeb2v4 uE4UeNAIG/JSJGgTe+5k0BYJrHczHSTA7UNi9BX9Qj+YdUP90G/Wh5F7KDWCpYob+8KV 79YG7s0IMKPH7NWo9Hwv3CqfFPX7l4xqtIOieSMVhKz500T6iPC8NuZmLQNo5EHr8pNk InsbHWLcrcLAEPly7A/kstwgTWE1qm15vf4BHRpNg9eErpl+lwFamPt22uZ7QwWvYbc9 ZmZA== Received: by 10.14.200.194 with SMTP id z42mr8860108een.13.1351876745260; Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id z43sm24505652een.16.2012.11.02.10.19.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 4F4784635B5; 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:31 +0100 Message-Id: <1351876722-5183-40-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 39/50] net: rtl8139: 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/rtl8139.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/rtl8139.c b/drivers/net/rtl8139.c index ed02cf6..15e9f5f 100644 --- a/drivers/net/rtl8139.c +++ b/drivers/net/rtl8139.c @@ -200,6 +200,16 @@ static struct pci_device_id supported[] = { {} }; +static struct eth_ops rtl8139_ops = { + init = rtl8139_probe, + halt = rtl_disable, + send = rtl_transmit, + recv = rtl_poll, +#ifdef CONFIG_MCAST_TFTP + mcast = rtl_bcast_addr +#endif +}; + int rtl8139_initialize(bd_t *bis) { pci_dev_t devno; @@ -229,13 +239,7 @@ int rtl8139_initialize(bd_t *bis) dev->priv = (void *) devno; dev->iobase = (int)bus_to_phys(iobase); - dev->eo->init = rtl8139_probe; - dev->eo->halt = rtl_disable; - dev->eo->send = rtl_transmit; - dev->eo->recv = rtl_poll; -#ifdef CONFIG_MCAST_TFTP - dev->eo->mcast = rtl_bcast_addr; -#endif + dev->eo = &rtl8139_ops; eth_register (dev);