From patchwork Wed Nov 21 13:23: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: 200719 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 D22332C007E for ; Thu, 22 Nov 2012 00:30:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9BF474A1FF; Wed, 21 Nov 2012 14:29:34 +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 lV1StzKu7Lgy; Wed, 21 Nov 2012 14:29:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 739FC4A0F3; Wed, 21 Nov 2012 14:27:30 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 081B44A057 for ; Wed, 21 Nov 2012 14:24:54 +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 Qp6HrtOOS-cI for ; Wed, 21 Nov 2012 14:24:53 +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 58D624A056 for ; Wed, 21 Nov 2012 14:24:28 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id a1so2241673eaa.3 for ; Wed, 21 Nov 2012 05:24:28 -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=c2d2r0hfF1zcYK6EXiUYAknz26fYhtxte0PB3aKfQOQ=; b=Ph2Sq0G6jd1aF9ef+WiV7qexxsSxDtyQHB4UQ7FD6uZNYkmWB5mRSlLQnL/cjTN69j vWbA4nPXQ+DeU2HqzM9VoroMv848RVP4V2AfZjKtxaVbcQRsGrTtFATPtO8lodicYGk7 0SPR9e+HfoV1VAdK61rCPxD/XXyCj7942jcE9ISYm8iFQ5rZuneidpdrf763jBDbb1FT K76EjyyJTgFnoIl57E4TDd8NnJDAj0bKMkigNp8XaF2h+exEK+gA2dTvt04gbN/2JDrj c1ER5cDS34dFamkEXzjaUe+DW3P3SZ4S1S8ayfG+dHW+paOV56gv6fqgfm0Hg1Uboyya dJzA== Received: by 10.14.174.194 with SMTP id x42mr45751838eel.22.1353504268226; Wed, 21 Nov 2012 05:24:28 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id d44sm183599eeo.10.2012.11.21.05.24.26 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:27 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id BE9E14636F6; Wed, 21 Nov 2012 14:24:20 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:11 +0100 Message-Id: <1353504238-11277-21-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 20/67] net: fec_mxc: 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/fec_mxc.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index f8a5556..3259f07 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev) return len; } +static struct eth_ops fec_ops = { + .init = fec_init, + .send = fec_send, + .recv = fec_recv, + .halt = fec_halt, + .write_hwaddr = fec_set_hwaddr +}; + + static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) { struct eth_device *edev; @@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) memset(fec, 0, sizeof(*fec)); edev->priv = fec; - edev->eo->init = fec_init; - edev->eo->send = fec_send; - edev->eo->recv = fec_recv; - edev->eo->halt = fec_halt; - edev->eo->write_hwaddr = fec_set_hwaddr; + edev->eo = &fec_ops; fec->eth = (struct ethernet_regs *)base_addr; fec->bd = bd;