From patchwork Fri Nov 2 17:18:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196665 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 193322C00C4 for ; Sat, 3 Nov 2012 04:27:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B23394A757; Fri, 2 Nov 2012 18:23: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 1Bs1AlQxpI4c; Fri, 2 Nov 2012 18:23:27 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A5E7B4A179; Fri, 2 Nov 2012 18:20:06 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81FEA4A1A3 for ; Fri, 2 Nov 2012 18:19:31 +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 Woh05YfiHf+T for ; Fri, 2 Nov 2012 18:19:31 +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 BB4094A119 for ; Fri, 2 Nov 2012 18:19:06 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187556eek.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=HdqIAWzZCURTsq9TNjRmWi56aJruMRJuvsuGaiRBoa4=; b=GrcOHj2n7K4Q2JA6GeZWn3IUAqs7Ten+Oy89xcyX/LmfVT3wTVa798JcfS2rmxF7Gw lf1wHbJsYskLB7yIdbaTpfsdmOVP+wpXI2XZYmGKPXxQOoaaEvMMk2SU3Dv85acUUSzv zs4+opy7gEZcXjsxeHrrtOlVf/PfeDi/2GGZHr6dKHGtvFqe1Kiecx/dhZw2JHjfsYcF NtD1HM7aqgRkdRVwatlNEivLYhYHUZB+7jes/rhr4hRwyHNkEtozoxXplgKQGtIqzB4s OaTKorkq+Puri5jzHRcn97La4dPG55ryKEIxRg9aTf/jn2lgSqaqbnroqbMgvEc953TC ChoA== Received: by 10.14.221.194 with SMTP id r42mr8795322eep.25.1351876746574; Fri, 02 Nov 2012 10:19:06 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id f3sm24500830eeo.13.2012.11.02.10.19.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 8EA474635EB; 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:40 +0100 Message-Id: <1351876722-5183-49-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 48/50] net: zynq_gem: 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/zynq_gem.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index 3cba176..0a9a0f0 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -399,6 +399,14 @@ static int zynq_gem_miiphy_write(const char *devname, uchar addr, return phywrite(dev, addr, reg, val); } +static struct eth_ops zynq_gem_ops = { + .init = zynq_gem_init, + .halt = zynq_gem_halt, + .send = zynq_gem_send, + .recv = zynq_gem_recv, + .write_hwaddr = zynq_gem_setup_mac +}; + int zynq_gem_initialize(bd_t *bis, int base_addr) { struct eth_device *dev; @@ -425,11 +433,7 @@ int zynq_gem_initialize(bd_t *bis, int base_addr) dev->iobase = base_addr; - dev->eo->init = zynq_gem_init; - dev->eo->halt = zynq_gem_halt; - dev->eo->send = zynq_gem_send; - dev->eo->recv = zynq_gem_recv; - dev->eo->write_hwaddr = zynq_gem_setup_mac; + dev->eo = &zynq_gem_ops; eth_register(dev);