From patchwork Wed Nov 21 13:23:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200755 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 34D422C0098 for ; Thu, 22 Nov 2012 00:36:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 137A14A39C; Wed, 21 Nov 2012 14:35:59 +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 9zNLkcn7L80p; Wed, 21 Nov 2012 14:35:58 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3B264A2E2; Wed, 21 Nov 2012 14:34:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3694F4A0F0 for ; Wed, 21 Nov 2012 14:32:42 +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 9MCdQBiR2NIP for ; Wed, 21 Nov 2012 14:32:41 +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 01B5B4A177 for ; Wed, 21 Nov 2012 14:32:16 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4438289eek.3 for ; Wed, 21 Nov 2012 05:32:16 -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=e+JeP7nTJut4xmy0S29x3d0RXVzkF/KmfoybIzeCT/c=; b=UYAcwJQ5YMr8QBXTloN4K5QARkdZFVtdADLGbUmLCEhnlwPLEoM7myddvrfhjm3gR3 uWqRcz0avqNmzBq48hTYjlvPkpOmT27T4DohdSZN4Y+T7WS19dIluOZvGKEAumMW+/Bw CpaMIruVCCFxYMb75LTDFO1GFIbl3/swOi3QazVlJG7dwV4xP/bMweJMGQ4RUMihTpE6 QeZ0e6iUVVnlfVp97Ve46NuwMUrOa1i38Wtg6uUxHYtr44SL/an4dZ1nBgAeyVlsE3OR hJt09V50KxxBLnMBIODumL7Tnbqpiw+pR+X8Lb/R/BPjPsrH4xe/xgjTtEWGZu0pCtDO Xlug== Received: by 10.14.175.133 with SMTP id z5mr12601036eel.15.1353504736360; Wed, 21 Nov 2012 05:32:16 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id e1sm257678eem.3.2012.11.21.05.32.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:32:15 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 6762C4637C5; 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:33 +0100 Message-Id: <1353504238-11277-43-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 42/67] 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 files 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++)