From patchwork Wed Nov 21 13:23:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200700 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 76E1D2C009F for ; Thu, 22 Nov 2012 00:27:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EFCAC4A08F; Wed, 21 Nov 2012 14:26:56 +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 moqCZq6js1bd; Wed, 21 Nov 2012 14:26:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 245474A0F8; Wed, 21 Nov 2012 14:25:03 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6CB734A0C0 for ; Wed, 21 Nov 2012 14:24:49 +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 ak+jQwgiyX6m for ; Wed, 21 Nov 2012 14:24:48 +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 33A9C4A04E for ; Wed, 21 Nov 2012 14:24:27 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433819eek.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=iQcdHH0CCfIc6HTpbFVoPHr39urOctYPIeIvx0h81zQ=; b=HErrv/aYLjr4l/mt5pa7E3YSIc+nVmhxrP+bwRIahJehrJvAuTnOPCTpFo9mqRGKLI YLwAgJa3ztnz5ccYJX5td0kMbwTxtKCb7pfGWDssyBvs3ObhTsC1tBMQ3ZQ8Y0kCc1/C QaF8wNdRTMvsUJtvUKC+na4IPLWM8OM4kIf3DG28TlhHi/j8Dcb579kkuM1dATT7fbyy ssZZyBnMWqGoH5qklNJpb0EBwFT0RUXpBAdSW3Kps2xjXyvWWXsqOazgFxZJvFPU9t/b hTkw3HH4b2N8yaB4qC7fiE0wYyAoE2q+RqGdxvWoro+oThXMLyHBMwltjZpAwO0rN2UW ANsA== Received: by 10.14.223.200 with SMTP id v48mr45667681eep.24.1353504267073; Wed, 21 Nov 2012 05:24:27 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id b44sm174005eep.12.2012.11.21.05.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:25 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 9A821463696; 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:06 +0100 Message-Id: <1353504238-11277-16-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 15/67] net: e1000: 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/e1000.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/e1000.c b/drivers/net/e1000.c index c9f9fb3..82e89d8 100644 --- a/drivers/net/e1000.c +++ b/drivers/net/e1000.c @@ -5118,6 +5118,13 @@ void e1000_get_bus_type(struct e1000_hw *hw) /* A list of all registered e1000 devices */ static LIST_HEAD(e1000_hw_list); +static struct eth_ops e1000_ops = { + .init = e1000_init, + .recv = e1000_poll, + .send = e1000_transmit, + .halt = e1000_disable +}; + /************************************************************************** PROBE - Look for an adapter, this routine's visible to the outside You should omit the last argument struct pci_device * for a non-PCI NIC @@ -5218,10 +5225,7 @@ e1000_initialize(bd_t * bis) nic->enetaddr[3], nic->enetaddr[4], nic->enetaddr[5]); /* Set up the function pointers and register the device */ - nic->eo->init = e1000_init; - nic->eo->recv = e1000_poll; - nic->eo->send = e1000_transmit; - nic->eo->halt = e1000_disable; + nic->eo = &e1000_ops; eth_register(nic); }