From patchwork Fri Nov 2 17:18:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196655 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 3BCFC2C00C4 for ; Sat, 3 Nov 2012 04:25:02 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8265B4A540; Fri, 2 Nov 2012 18:22:19 +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 aATj-trPbwry; Fri, 2 Nov 2012 18:22:19 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 14CC24A1DF; Fri, 2 Nov 2012 18:19:42 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8CF504A16E for ; Fri, 2 Nov 2012 18:19:25 +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 l9l3PnQq2-3h for ; Fri, 2 Nov 2012 18:19:23 +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 846DB4A170 for ; Fri, 2 Nov 2012 18:19:04 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625229eaa.3 for ; Fri, 02 Nov 2012 10:19:04 -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=ef5HaiaIaaa78mdFwyW6KI0cY71QfvDBDv1gXJ3d24s=; b=FD31y2ffdqFZhe5qa6ICairsf05akhbKYW2YgmiOos4pF26cmHXuJ/S8eZLAAphrhQ p+rjJn+pLYa4W4rw7iO+JbU823FDOxgW6H05GC7LZJj8w/5LjTJlfS7hTYet8e0m7kpa 84V5GoXYS4V4sR8L6PS0mpm9KQfiT3LILF5KXOeBbi2/+PCW7LeM7ZAs17CnbT+xXZAv ASgGUV3jH1SeVSr/tu+zxfEIiQiXE08kH5MSxH/jXEII4Z8L2FH03pSLRHKv+ruyRyna 1H90xn8wK1sFOFEsj7xPu7cmBXvJGxNo5+UHjH+s3k0gIziK2lro9/tJrk1YRglJbKIE 7VdQ== Received: by 10.14.213.65 with SMTP id z41mr8671212eeo.29.1351876744428; Fri, 02 Nov 2012 10:19:04 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id g5sm24523847eem.4.2012.11.02.10.19.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id DEAB546345E; 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:16 +0100 Message-Id: <1351876722-5183-25-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 24/50] net: fsl_mcdmafec: 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/fsl_mcdmafec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/fsl_mcdmafec.c b/drivers/net/fsl_mcdmafec.c index 2e70d22..6a18809 100644 --- a/drivers/net/fsl_mcdmafec.c +++ b/drivers/net/fsl_mcdmafec.c @@ -512,6 +512,13 @@ static void fec_halt(struct eth_device *dev) #endif } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int mcdmafec_initialize(bd_t * bis) { struct eth_device *dev; @@ -533,10 +540,7 @@ int mcdmafec_initialize(bd_t * bis) sprintf(dev->name, "FEC%d", fec_info[i].index); dev->priv = &fec_info[i]; - dev->eo->init = fec_init; - dev->eo->halt = fec_halt; - dev->eo->send = fec_send; - dev->eo->recv = fec_recv; + dev->eo = &fec_ops; /* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_DMA_USE_INTSRAM