From patchwork Wed Nov 21 13:23:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200727 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 8E4762C0097 for ; Thu, 22 Nov 2012 00:31:43 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 07C614A28A; Wed, 21 Nov 2012 14:30:29 +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 K81MY85ADtJ6; Wed, 21 Nov 2012 14:30:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD6804A169; Wed, 21 Nov 2012 14:27:39 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D76A4A053 for ; Wed, 21 Nov 2012 14:25:13 +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 rrOY-AyQq-ZI for ; Wed, 21 Nov 2012 14:25:13 +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 CF8404A0AF for ; Wed, 21 Nov 2012 14:24:33 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433757eek.3 for ; Wed, 21 Nov 2012 05:24:33 -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=udgHWQPbteDgE0FDlM+6WV2ZGAIhv6TLS1ICZ/XV96w=; b=WQbYVbJimxzoeE6bSnn7Y8FQgvUmKBaOqFKheR+ho4Mt3dgW6j/62R57MIq3k/2KvF Q/eMXNRZE1ElNlf/epYQtZHsI3XOBn9jN2sq9l8NiSiAptEUzu7J9gtYhMDuLFI3ZTO1 amCXbInwNQ1BpPAc7Z7qBYJIPCv2S7k+0cBNNZ6KBiO/kRpGOOvnqbVbRJ/1pUesb2/L TjR3RMhDNQhQ1ReTHONVtg0ProEYbEs0196bmruydrZC6kfhTz3Gh79H3yP5OXnTpnEO PVNOq99ZbON170uaMOOVdAqdnv98sQmO3Jk/Xz0q++bWhJTxSAIgPaiu/898YlN3UyqI OukQ== Received: by 10.14.203.69 with SMTP id e45mr45401435eeo.38.1353504273747; Wed, 21 Nov 2012 05:24:33 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id d44sm183978eeo.10.2012.11.21.05.24.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:32 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 8C8744637D6; Wed, 21 Nov 2012 14:24:21 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:38 +0100 Message-Id: <1353504238-11277-48-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 47/67] 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 files 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);