From patchwork Fri Nov 2 17:18:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196664 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 668402C00C4 for ; Sat, 3 Nov 2012 04:27:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1F3264A729; Fri, 2 Nov 2012 18:23:21 +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 qdHTF4ngUji1; Fri, 2 Nov 2012 18:23:20 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 590094A238; Fri, 2 Nov 2012 18:20:05 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3A2E4A1B8 for ; Fri, 2 Nov 2012 18:19:36 +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 8T+bQOhujYUD for ; Fri, 2 Nov 2012 18:19:36 +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 9A00B4A177 for ; Fri, 2 Nov 2012 18:19:06 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187547eek.3 for ; Fri, 02 Nov 2012 10:19:06 -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=aGL1ms/44EPfWVFUy9gokXp0MHnZeAVufpgk5rIIarE=; b=tBwJOTTHzxCNUsESen8N7ldJe+3yWDjvtazzrxFJP2Xdad1RhVgHkiITBPiKzclntK Uu6i72599ayL7h8Y9qj7WjkjlMNaNIVMs6tx+RpzZhO33xNx4WQWlV45w4xfsQS15jCU FxpM216qh+JJxdbkhC4Pqycr7NaV0MwZdbi7EGb1R0vf8knB0fpBCWxkAS0lvAqmZOG4 zLWNK3mJm7QJCkRVS6IpWNQyATEf4Esmby1TNIRwYXOkuKo58XUENlBYYyDOD2S2rWie Sz1E4KrCDgVXYdE3nYFOjkMY8L/w3MgGcrhSYzSPvjryC21QTKgJfqjPVONpD9hNRwaZ 7iCg== Received: by 10.14.205.3 with SMTP id i3mr8834036eeo.18.1351876746426; Fri, 02 Nov 2012 10:19:06 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id d44sm24507305eeo.10.2012.11.02.10.19.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:06 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 878B54635E8; 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:39 +0100 Message-Id: <1351876722-5183-48-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 47/50] net: xilinx_emaclite: 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/xilinx_emaclite.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c index c0fefa7..b5be0a3 100644 --- a/drivers/net/xilinx_emaclite.c +++ b/drivers/net/xilinx_emaclite.c @@ -345,6 +345,13 @@ static int emaclite_recv(struct eth_device *dev) } +static struct eth_ops emaclite_ops = { + init = emaclite_init, + halt = emaclite_halt, + send = emaclite_send, + recv = emaclite_recv +}; + int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, int txpp, int rxpp) { @@ -369,10 +376,7 @@ int xilinx_emaclite_initialize(bd_t *bis, unsigned long base_addr, sprintf(dev->name, "Xelite.%lx", base_addr); dev->iobase = base_addr; - dev->eo->init = emaclite_init; - dev->eo->halt = emaclite_halt; - dev->eo->send = emaclite_send; - dev->eo->recv = emaclite_recv; + dev->eo = &emaclite_ops; eth_register(dev);