From patchwork Wed Nov 21 13:23:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200718 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 452922C007E for ; Thu, 22 Nov 2012 00:30:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 64F6F4A11C; Wed, 21 Nov 2012 14:29:27 +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 n3DJfTS5TMCk; Wed, 21 Nov 2012 14:29:27 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 86FB44A138; Wed, 21 Nov 2012 14:27:29 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C04334A054 for ; Wed, 21 Nov 2012 14:24:53 +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 AK5gE0cr-Hcu for ; Wed, 21 Nov 2012 14:24:52 +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 627A04A057 for ; Wed, 21 Nov 2012 14:24:28 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433819eek.3 for ; Wed, 21 Nov 2012 05:24:28 -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=43XI8Q1bf0SjZ/31OEKFUBhjDz/2fHrGg+r+JdQ4IrM=; b=DpCbMdu1Jr06uGBYYKuDLbv62pw2oAn6KgZgTmXQCgq9IDhj7KQH4W/yQQHlwgCOT+ KCn1u/EE0+7fCYJ4bZVbtpLjxsoYHErhpqOgyN+1I/DXTEP+uq81Fcs5LVh9RyXtgyRO F4BPtYqjepz+j8fScQJtXoj+fUNkCREobcpRBWc9aJJpegHUXoMI7cdKrW0XjIz1ToD9 zgG1DO3zUl/ITlZKyH+pGVie8v4BXkrsnbszepJYaARQVPmq58U9EixS5kzIKeVBTDjl W5lg8PKxqfg8X5TCzVgzPQl6Darkkhka2d1Ntv+b9cgQ7zh45zAq6wTFu5Jk4bKaM7FK I6RQ== Received: by 10.14.203.2 with SMTP id e2mr22779910eeo.20.1353504268269; Wed, 21 Nov 2012 05:24:28 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id d44sm183553eeo.10.2012.11.21.05.24.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:27 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id CC32B463727; 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:13 +0100 Message-Id: <1353504238-11277-23-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 22/67] net: greth.c: 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/greth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/greth.c b/drivers/net/greth.c index 150dccf..3794005 100644 --- a/drivers/net/greth.c +++ b/drivers/net/greth.c @@ -597,6 +597,13 @@ void greth_set_hwaddr(greth_priv * greth, unsigned char *mac) mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); } +static struct eth_ops greth_ops = { + .init = greth_init, + .halt = greth_halt, + .send = greth_send, + .recv = greth_recv +}; + int greth_initialize(bd_t * bis) { greth_priv *greth; @@ -623,10 +630,7 @@ int greth_initialize(bd_t * bis) debug("Found GRETH at %p, irq %d\n", greth->regs, greth->irq); dev->priv = (void *)greth; dev->iobase = (unsigned int)greth->regs; - dev->eo->init = greth_init; - dev->eo->halt = greth_halt; - dev->eo->send = greth_send; - dev->eo->recv = greth_recv; + dev->eo = &greth_ops; greth->dev = dev; /* Reset Core */