From patchwork Fri Nov 2 17:18:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196666 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 296F32C00C8 for ; Sat, 3 Nov 2012 04:28:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B4CF64A22C; Fri, 2 Nov 2012 18:23:33 +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 rQ9SwUcDHyak; Fri, 2 Nov 2012 18:23:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9D9AE4A232; Fri, 2 Nov 2012 18:20:07 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D7DF14A1B8 for ; Fri, 2 Nov 2012 18:19:37 +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 rGmOdvqbg+mb for ; Fri, 2 Nov 2012 18:19:35 +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-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id A2B2F4A178 for ; Fri, 2 Nov 2012 18:19:06 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625229eaa.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=Nfsx+eJ1P84cR7FpgexL1cufcNTbHrtcPFFRl/JMDm4=; b=LzjKQKSVstBFIu/ZpHFiGWKh+k+K0yDdh8JAGbQ+ViYiR7+OeqqKoidpz4oFx5N9rI tOTAWu1xUVRtWeXzfrlEpZxxQInPtdStKG214UEI6ThmWs+bGTu/URCm6DSKaLStZc03 mqcOmy2tlYdWuQ1MZyb3EBGL7HkMDrBWCqf8NDKZSxfjYAJgnFliiGmjt2QEunYHulx1 Q3w9Z7wKm3Z3Hv57zRgeuG/THbQSiwkheFMDQs8YAEPSm+0YWJAW3JdSFLKrG1MUfpb+ 2kU09dp2ZOG1Iq/lgN4mZGgfu568SSUNXCghCiVcGs/sMi4PA2yz8priyZt2hlFX4g9o PoLA== Received: by 10.14.216.193 with SMTP id g41mr8718200eep.37.1351876746437; Fri, 02 Nov 2012 10:19:06 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id e1sm24527563eem.3.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 6C8B64635C7; 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:35 +0100 Message-Id: <1351876722-5183-44-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 43/50] net: tsec: 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/tsec.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index 345d563..034f0ed 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -605,6 +605,16 @@ static int init_phy(struct eth_device *dev) return 1; } +static struct eth_ops tsec_ops = { + .init = tsec_init, + .halt = tsec_halt, + .send = tsec_send, + .recv = tsec_recv, +#ifdef CONFIG_MCAST_TFTP + .mcast = tsec_mcast_addr +#endif +}; + /* Initialize device structure. Returns success if PHY * initialization succeeded (i.e. if it recognizes the PHY) */ @@ -638,13 +648,7 @@ static int tsec_initialize(bd_t *bis, struct tsec_info_struct *tsec_info) priv->bus = miiphy_get_dev_by_name(tsec_info->mii_devname); dev->iobase = 0; dev->priv = priv; - dev->eo->init = tsec_init; - dev->eo->halt = tsec_halt; - dev->eo->send = tsec_send; - dev->eo->recv = tsec_recv; -#ifdef CONFIG_MCAST_TFTP - dev->eo->mcast = tsec_mcast_addr; -#endif + dev->eo = &tsec_ops; /* Tell u-boot to get the addr from the env */ for (i = 0; i < 6; i++)