From patchwork Fri Nov 2 17:17:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196630 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 EEFF72C0084 for ; Sat, 3 Nov 2012 04:19:48 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 838ED4A1F9; Fri, 2 Nov 2012 18:19:46 +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 RgX-kXmYcHKV; Fri, 2 Nov 2012 18:19:46 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 51E454A17D; Fri, 2 Nov 2012 18:19:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DF86E4A15E for ; Fri, 2 Nov 2012 18:19:05 +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 Rqty8ioJyFPG for ; Fri, 2 Nov 2012 18:19:05 +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 BCFB44A119 for ; Fri, 2 Nov 2012 18:18:57 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625261eaa.3 for ; Fri, 02 Nov 2012 10:18:57 -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=XECUJKAjuhohCQy3hKZanO+wlzbXyQO2L2YC61hqa/k=; b=vQNyv+YXWtM5StnXtxC9oR5yMaU7BFHH3xC+hjoaKRgxB78C4Vq89getcCace2ZkUq QaH8Scti9T6EDrJxLHBodKeqxTDV0q3joFWKz3IgG9l2RfumdCaSk0T4KKt3H0JFIVlA QntT6OS1FlFKpBNQRyCgFG6IkMSQ0yrzwumhZ4qWdycnSek+npJFpc5oM6VeNsVqgkaq 5YM/3KSUdk5ZS2UT0xWzTPNbw6JpbP1EFelGqM4yzv0pfLijT1HsNZu01LufdET1tAuY I8K/AZZjA2MMa0DZHXCJF+yeMJN6dgTHEYFDdGzG50ko9E8inQLK7wMnA044vW9Nkzrv rrbw== Received: by 10.14.203.69 with SMTP id e45mr8666171eeo.38.1351876737221; Fri, 02 Nov 2012 10:18:57 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id i1sm24511572eeo.8.2012.11.02.10.18.55 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:18:55 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 43E83461BB5; Fri, 2 Nov 2012 18:18:54 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:17:57 +0100 Message-Id: <1351876722-5183-6-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 05/50] net: armada100_fec: 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/armada100_fec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/armada100_fec.c b/drivers/net/armada100_fec.c index f256381..d826e11 100644 --- a/drivers/net/armada100_fec.c +++ b/drivers/net/armada100_fec.c @@ -678,6 +678,13 @@ static int armdfec_recv(struct eth_device *dev) return 0; } +static struct eth_ops armada100_fec_ops = { + .init = armdfec_init, + .halt = armdfec_halt, + .send = armdfec_send, + .recv = armdfec_recv +}; + int armada100_fec_register(unsigned long base_addr) { struct armdfec_device *darmdfec; @@ -718,10 +725,7 @@ int armada100_fec_register(unsigned long base_addr) /* must be less than sizeof(dev->name) */ strcpy(dev->name, "armd-fec0"); - dev->eo->init = armdfec_init; - dev->eo->halt = armdfec_halt; - dev->eo->send = armdfec_send; - dev->eo->recv = armdfec_recv; + dev->eo = &armada100_fec_ops; eth_register(dev);