From patchwork Fri Nov 2 17:18:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196638 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 04F622C00C8 for ; Sat, 3 Nov 2012 04:21:36 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD3D34A2B0; Fri, 2 Nov 2012 18:20:44 +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 IY7t-VsrRrza; Fri, 2 Nov 2012 18:20:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DDCE64A161; Fri, 2 Nov 2012 18:19:24 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 755C94A18A for ; Fri, 2 Nov 2012 18:19:13 +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 D8al1X9ba7-y for ; Fri, 2 Nov 2012 18:19:12 +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 B66FD4A152 for ; Fri, 2 Nov 2012 18:18:59 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625264eaa.3 for ; Fri, 02 Nov 2012 10:18:59 -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=ZI76zhgALXyd7bWRu9pUbez2rJvQEYH21Nd27sewcLs=; b=H2QdtWcHcALgEozUUfW9GXbMzjBnD67zXJmsG7qB/kIQ3ioTkmcvzh413drb6OTUAf jEQTw4S7oRvbcMqFUYTBHMtlmlO+TKKH9LgzPcVLnn767u6NkMNNTGAgzOgJ+epFRpvM HV1wBtKQyDCjQNinXew+1TAQCF4zG9117LXeXT8KcfFNbtFC4/x2OIAs/gBCQQ+3A3yz OLYiha/CCDqoCHzMo1OZ/9muM0hF6o2Sd/Af4yoklrt0AhbfFLsJ19ixpuYZv5SxLIPF RfqH30RtoztLovCpC8WGyfV0Z/bMu8BM5btkADbEUpjteAeyU7DABFt0TibqeCQggZEa NLhQ== Received: by 10.14.179.6 with SMTP id g6mr8595095eem.46.1351876739546; Fri, 02 Nov 2012 10:18:59 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id g47sm24519404eeo.6.2012.11.02.10.18.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:18:58 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 734AB46302E; 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:03 +0100 Message-Id: <1351876722-5183-12-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 11/50] net: cs8900: 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/cs8900.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 65a4254..a78eada 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, u16 value) return 0; } +static struct eth_ops cs8900_ops = { + .init = cs8900_init, + .halt = cs8900_halt, + .send = cs8900_send, + .recv = cs8900_recv +}; + int cs8900_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->eo->init = cs8900_init; - dev->eo->halt = cs8900_halt; - dev->eo->send = cs8900_send; - dev->eo->recv = cs8900_recv; + dev->eo = &cs8900_ops; /* Load MAC address from EEPROM */ cs8900_get_enetaddr(dev);