From patchwork Fri Nov 2 17:18:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196659 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 43EEA2C00C8 for ; Sat, 3 Nov 2012 04:26:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C7EEC4A61B; Fri, 2 Nov 2012 18:22:44 +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 hZe7MKIOcDeQ; Fri, 2 Nov 2012 18:22:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFB804A1F6; Fri, 2 Nov 2012 18:19:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C5E3E4A19D for ; Fri, 2 Nov 2012 18:19:28 +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 oHAS2qDdgryw 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 30AF54A175 for ; Fri, 2 Nov 2012 18:19:05 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625264eaa.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=trJG3aaLQLbWSlZRBxfRb8FaPkB5BvZ9CxPnhFQVSpQ=; b=s8F7d3N33+iTDjLT9NsOO4RRwMFLbfvvaFNQCkZbaNZl4tGEJ2EqccPBAfkXWScP1p lrOiUQib8Su1gUy61AOhB6iTsCqnhYg8Dhok/s0pdsQ68WllLYyr4Szs92NQc7W9WAol I218DijZfzhjmdLRuM+eYcWV2TaaRIp5JkD6JJi3sKKuc9BC/deWgurwpPvjgwUHn9wt zckQzWyYg+/s0ME3+pS4p2YqlKf3ZkzUW7EqhFMQ4GEcol8n6Rc8lyD7GPRJwtAHy8Ex 5RkJ2Z5FF2uGh8x3YkkRmYzgznVQYabInziAn/LF3nQJ9nyGjcnfnew6BCftW4MOpAgM c18w== Received: by 10.14.194.72 with SMTP id l48mr8953532een.9.1351876745077; Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id g5sm24523915eem.4.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 48C394635B0; 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:30 +0100 Message-Id: <1351876722-5183-39-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 38/50] net: plb2800_eth: 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/plb2800_eth.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/plb2800_eth.c b/drivers/net/plb2800_eth.c index d3eb692..3b5861f 100644 --- a/drivers/net/plb2800_eth.c +++ b/drivers/net/plb2800_eth.c @@ -92,6 +92,12 @@ static unsigned char * plb2800_get_mac_addr(void); static int rx_new; static int mac_addr_set = 0; +static struct eth_ops plb2800_eth_ops = { + .init = plb2800_eth_init, + .halt = plb2800_eth_halt, + .send = plb2800_eth_send, + .recv = plb2800_eth_recv +}; int plb2800_eth_initialize(bd_t * bis) { @@ -110,10 +116,7 @@ int plb2800_eth_initialize(bd_t * bis) memset(dev, 0, sizeof(*dev)); sprintf(dev->name, "PLB2800 Switch"); - dev->eo->init = plb2800_eth_init; - dev->eo->halt = plb2800_eth_halt; - dev->eo->send = plb2800_eth_send; - dev->eo->recv = plb2800_eth_recv; + dev->eo = &plb2800_eth_ops; eth_register(dev);