From patchwork Wed Nov 21 13:22:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200698 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 935662C009A for ; Thu, 22 Nov 2012 00:26:58 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3362D4A052; Wed, 21 Nov 2012 14:26:35 +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 LPfk3PYDjvDq; Wed, 21 Nov 2012 14:26:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8D32E4A0F3; Wed, 21 Nov 2012 14:24:58 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5D2794A04B for ; Wed, 21 Nov 2012 14:24:46 +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 hIO3zov4lMeH for ; Wed, 21 Nov 2012 14:24:45 +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 6CB214A048 for ; Wed, 21 Nov 2012 14:24:23 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433757eek.3 for ; Wed, 21 Nov 2012 05:24:23 -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=/y+7X4lUOUjyR72m+A/Z5dJNzO+fPj84v7gaNbHlch4=; b=KHInYGIh/pchL23K2X8y4EutGZLZD/QEGLKsuuS5n8BZVXafWZyqRtp+2YtsDdr3Ft OLr7ZUknMt1NvZUu5DOKsV7AXcXbduw+cVBKaoBpaPoRqEq8VYO56FkzSpVvxj1pZMgy 3jd2zJh30wT/Gr0j0aWZOxVd+0No3UTDg5Bphj5B3BojZM2dYwylnngBidfiNDFyqSwQ bXWVP4nDTCRmL6ITg5i1bCeQ3H5YSC0lR9TnIq4Mn95SVcEJfOj+xJEAtK/+aq/cH6ha wGczplHBAox/NXLMy65wm9Bh3xdmf53Wv5P5XCt0lXLXv75bzhgmeg/F+zFw5roEqN2Y 8Y/A== Received: by 10.14.210.200 with SMTP id u48mr44572839eeo.29.1353504263569; Wed, 21 Nov 2012 05:24:23 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id a44sm197085eeo.7.2012.11.21.05.24.21 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:22 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 356D9462C7C; Wed, 21 Nov 2012 14:24:20 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:22:53 +0100 Message-Id: <1353504238-11277-3-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 02/67] net: 4xx_enet: 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/4xx_enet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/4xx_enet.c b/drivers/net/4xx_enet.c index 27b66dd..309e616 100644 --- a/drivers/net/4xx_enet.c +++ b/drivers/net/4xx_enet.c @@ -1905,6 +1905,13 @@ static int ppc_4xx_eth_rx (struct eth_device *dev) return length; } +static struct eth_ops ppc_4xx_eth_ops = { + .init = ppc_4xx_eth_init, + .send = ppc_4xx_eth_send, + .recv = ppc_4xx_eth_rx, + .halt = ppc_4xx_eth_halt +}; + int ppc_4xx_eth_initialize (bd_t * bis) { static int virgin = 0; @@ -2023,10 +2030,7 @@ int ppc_4xx_eth_initialize (bd_t * bis) sprintf (dev->name, "ppc_4xx_eth%d", eth_num - CONFIG_EMAC_NR_START); dev->priv = (void *) hw; - dev->eo->init = ppc_4xx_eth_init; - dev->eo->halt = ppc_4xx_eth_halt; - dev->eo->send = ppc_4xx_eth_send; - dev->eo->recv = ppc_4xx_eth_rx; + dev->eo = &ppc_4xx_eth_ops; eth_register(dev);