From patchwork Wed Nov 21 13:23:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200699 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 E6CB72C009A for ; Thu, 22 Nov 2012 00:27:07 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F292B4A088; Wed, 21 Nov 2012 14:26:45 +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 Hisga5cG5VVo; Wed, 21 Nov 2012 14:26:45 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EFB354A0F1; Wed, 21 Nov 2012 14:24:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B55F14A04B for ; Wed, 21 Nov 2012 14:24:48 +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 jI7n9uqFzmFW for ; Wed, 21 Nov 2012 14:24:47 +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 095F24A04C for ; Wed, 21 Nov 2012 14:24:26 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433803eek.3 for ; Wed, 21 Nov 2012 05:24:26 -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=WAJgxDXC1EO+X4bCeduaVzZHSwDEApNxxRYYtqkqspQ=; b=UkuvtrxzvuPx0+NLDSE4JMxMbOROdoaPxFZKWEMrrB6v3ToqUqJDd51W2Nc5b5qo/Y dVknyaYeu43o1XHnwldm1RrBiLJsHgGv8/ts/FV/CFw7wxd9M3ogy89QkphP0eA6K5ky LGlpST5kJr8ascEbPua2LnzkJHegH7oGPS8Zl0F+rR8rOOkDLYR4k0kyRx1HPsqfGEAw //vUSHZFfR259ZbY7hRL2h9cZk81MMjNSHVLSXFLwdZpusWd3pnV63GBvWMiCYKIha+5 5QKb378jItwtCZbXbsAtLgG+m6rgMJ4PDc+g9O5yCnYOrMxVjNrV0XYWZFNWb82sk2yD dyEw== Received: by 10.14.211.135 with SMTP id w7mr37699612eeo.4.1353504266929; Wed, 21 Nov 2012 05:24:26 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id e1sm218810eem.3.2012.11.21.05.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:25 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 942C846364E; 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:05 +0100 Message-Id: <1353504238-11277-15-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 14/67] net: dnet: 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/dnet.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/dnet.c b/drivers/net/dnet.c index be0891f..126828e 100644 --- a/drivers/net/dnet.c +++ b/drivers/net/dnet.c @@ -355,6 +355,13 @@ static void dnet_halt(struct eth_device *netdev) dnet_writew_mac(dnet, DNET_INTERNAL_MODE_REG, 0); } +static struct eth_ops dnet_ops = { + .init = dnet_init, + .halt = dnet_halt, + .send = dnet_send, + .recv = dnet_recv +}; + int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct dnet_device *dnet; @@ -374,10 +381,7 @@ int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr) dnet->phy_addr = phy_addr; sprintf(netdev->name, "dnet%d", id); - netdev->eo->init = dnet_init; - netdev->eo->halt = dnet_halt; - netdev->eo->send = dnet_send; - netdev->eo->recv = dnet_recv; + netdev->eo = &dnet_ops; dev_capa = readl(&dnet->regs->VERCAPS) & 0xFFFF; debug("%s: has %smdio, %sirq, %sgigabit, %sdma\n", netdev->name,