From patchwork Fri Nov 2 17:18:11 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196642 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 D88672C0084 for ; Sat, 3 Nov 2012 04:22:35 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CD2B04A369; Fri, 2 Nov 2012 18:21:09 +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 wLGqFERsdWL9; Fri, 2 Nov 2012 18:21:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6D34A4A1A2; Fri, 2 Nov 2012 18:19:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9C894A197 for ; Fri, 2 Nov 2012 18:19:16 +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 nscQEFIAv9ew for ; Fri, 2 Nov 2012 18:19:16 +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 07F224A154 for ; Fri, 2 Nov 2012 18:19:01 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187551eek.3 for ; Fri, 02 Nov 2012 10:19:01 -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=aYRIUtgZ4cyAccGom4DQZ2o+V2+MBNq+oBALzc/rPvI=; b=Dj5zyzSIuq7K1OKxSzLhcZuVLgeE9Gy7pKA3K/kUJ0AedOgOtkn4fGF2DM7+HtGFSg cwiPu8VMtZcAP7LWf8ascag3Fjt8L7XdsR5fa1JP/RgYAiWsW3K972dMrDATsg/b5w1x d+JW2TU3aiiBkBg/m/Z1BwJx2P1fh5MvxyRQJq4coU5CSbRN3unMlI+itfLthmkWbCzE MnnKrs8U2u0uQiQEmncJqdtnwppM+HEtNzILnJdLc9ALQFgI38X7VblN37Ks2pIVmNdx 0VNAfSk0wmqVbdT8ShX8kMjRj4ac3PCCQ/+llE1z0kPJ3QdVpwopt/sNdo75/a4LU8ph lyHw== Received: by 10.14.194.71 with SMTP id l47mr8851944een.6.1351876741900; Fri, 02 Nov 2012 10:19:01 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id s1sm24507809eem.9.2012.11.02.10.18.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:00 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id B6319463275; Fri, 2 Nov 2012 18:18:54 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:18:11 +0100 Message-Id: <1351876722-5183-20-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 19/50] net: ep93xx_eth: 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/ep93xx_eth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ep93xx_eth.c b/drivers/net/ep93xx_eth.c index 0b5cb3c..a2a1502 100644 --- a/drivers/net/ep93xx_eth.c +++ b/drivers/net/ep93xx_eth.c @@ -439,6 +439,13 @@ int ep93xx_miiphy_initialize(bd_t * const bd) } #endif +static struct eth_dev ep93xx_eth_ops = { + .init = ep93xx_eth_open, + .halt = ep93xx_eth_close, + .send = ep93xx_eth_send_packet, + .recv = ep93xx_eth_rcv_packet +}; + /** * Initialize the EP93xx MAC. The MAC hardware is reset. Buffers are * allocated, if necessary, for the TX and RX descriptor and status queues, @@ -499,10 +506,7 @@ int ep93xx_eth_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->eo->init = ep93xx_eth_open; - dev->eo->halt = ep93xx_eth_close; - dev->eo->send = ep93xx_eth_send_packet; - dev->eo->recv = ep93xx_eth_rcv_packet; + dev->eo = &ep93xx_eth_ops; sprintf(dev->name, "ep93xx_eth-%hu", dev_num);