From patchwork Wed Nov 21 13:23:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200734 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 A10B72C01E5 for ; Thu, 22 Nov 2012 00:32:49 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BA9EF4A195; Wed, 21 Nov 2012 14:31: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 dXWxMuVCzdH9; Wed, 21 Nov 2012 14:31:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 81F624A196; Wed, 21 Nov 2012 14:27:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A1A2F4A053 for ; Wed, 21 Nov 2012 14:25: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 g-LsUAea1yk1 for ; Wed, 21 Nov 2012 14:25:18 +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 B26444A02D for ; Wed, 21 Nov 2012 14:24:34 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433879eek.3 for ; Wed, 21 Nov 2012 05:24:34 -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=f05AGPNxJrsRS7izJd/7kzcYZhULsjiRrjsAiBMJT2M=; b=M9APXmVtOh/2MojpqHlbCZmXFoXpJBYWwHGip63hLMRTot4xit5sj2mgQIh6ElbGVh BM3CZ/g9nS8S573qrOaLG88D7yteb4CHoLBE+pqnnDdXPRtuTMe24WLzIS3dreQS/y6W xEVK9rDHw60QfTM/kH8I3Vj1yRm949wf7OUYgtBV8XS2TmYGH4NS+upim2IhZOL/6HpV Yr2G6luImmzkEjb1Gs11aOzD4DJDUTqkiBOYgAVZrbsYTlBXWOm6bU6QGFnMX13VtV3P sg974wexZs1VvcZlDRunCLtD7ic/+50fP4clYfaJ8ugY0j2BfNl7kTadmcQCvszUHTxx XEMg== Received: by 10.14.194.72 with SMTP id l48mr45751921een.9.1353504274617; Wed, 21 Nov 2012 05:24:34 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id k2sm157601eep.15.2012.11.21.05.24.32 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:33 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id CBA6F4637EA; Wed, 21 Nov 2012 14:24:21 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:47 +0100 Message-Id: <1353504238-11277-57-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 56/67] net: db64360/mv_eth: 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 --- board/Marvell/db64360/mv_eth.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/board/Marvell/db64360/mv_eth.c b/board/Marvell/db64360/mv_eth.c index 226b964..a0aafc7 100644 --- a/board/Marvell/db64360/mv_eth.c +++ b/board/Marvell/db64360/mv_eth.c @@ -202,6 +202,13 @@ void db64360_eth_disable (struct eth_device *dev) } +static struct eth_ops mv6436x_eth_ops = { + .init = (void *) db64360_eth_probe, + .halt = (void *) ethernet_phy_reset, + .send = (void *) db64360_eth_transmit, + .recv = (void *) db64360_eth_poll +}; + void mv6436x_eth_initialize (bd_t * bis) { struct eth_device *dev; @@ -259,10 +266,7 @@ void mv6436x_eth_initialize (bd_t * bis) /* ronen - set the MAC addr in the HW */ eth_port_uc_addr_set (devnum, dev->enetaddr, 0); - dev->eo->init = (void *) db64360_eth_probe; - dev->eo->halt = (void *) ethernet_phy_reset; - dev->eo->send = (void *) db64360_eth_transmit; - dev->eo->recv = (void *) db64360_eth_poll; + dev->eo = &mv6436x_eth_ops; ethernet_private = calloc (sizeof (*ethernet_private), 1); dev->priv = (void *) ethernet_private;