From patchwork Wed Nov 21 13:23:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200714 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 317192C007E for ; Thu, 22 Nov 2012 00:29:40 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 75BAA4A201; Wed, 21 Nov 2012 14:29: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 Q3srkaThYhlf; Wed, 21 Nov 2012 14:29:13 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 78D6B4A130; Wed, 21 Nov 2012 14:27:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4C8884A102 for ; Wed, 21 Nov 2012 14:25:08 +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 WhIrFr88Pbqi for ; Wed, 21 Nov 2012 14:25: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-ee0-f66.google.com (mail-ee0-f66.google.com [74.125.83.66]) by theia.denx.de (Postfix) with ESMTPS id 157554A0A2 for ; Wed, 21 Nov 2012 14:24:30 +0100 (CET) Received: by mail-ee0-f66.google.com with SMTP id d17so1492564eek.9 for ; Wed, 21 Nov 2012 05:24:30 -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=A/LfKhnTV5wn/79fLIniLIPzWKp3yH1E/DPELxXqQ+0=; b=diP+L4jqGrhvqMXBcXS3PjCrJcoSBtsKVWTrCk8zR8Efc2MXN4e90qZEuGd7w1ZCxe bB/QfohqUB2PaTdfXHkWwzF0PoI1vC/alYzQoZWV1N8+TuZCEeASCObTXCFtJYl0G7ov PYksdr9AhI0z8Exg6L1TgHtXZtYqakQZHFNiieXHD7Elf4DhAtuOBDWFzNsVVw5Phe8V qE9Xu2PL+zdo3tiV3ES3aFYMMuN3aoujRH+QAGORFnaqTNIqbEMoWeLjLRDTi72zr9Ha 5sx2OgPIoGdJV6HqooTXi5UcsalWyFv+CY7DXNq6aJ2ahMEUJ134N0HlzPHMs20mwYDF sEPg== Received: by 10.14.203.69 with SMTP id e45mr45400929eeo.38.1353504270102; Wed, 21 Nov 2012 05:24:30 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id d44sm183807eeo.10.2012.11.21.05.24.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:29 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 2E87C46379A; 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:25 +0100 Message-Id: <1353504238-11277-35-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 34/67] net: npe: 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/npe/npe.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/npe/npe.c b/drivers/net/npe/npe.c index d376c21..adff561 100644 --- a/drivers/net/npe/npe.c +++ b/drivers/net/npe/npe.c @@ -576,6 +576,13 @@ static int npe_rx(struct eth_device *dev) return 0; } +static struct eth_ops npe_ops = { + .init = npe_init, + .halt = npe_halt, + .send = npe_send, + .recv = npe_rx +}; + int npe_initialize(bd_t * bis) { static int virgin = 0; @@ -625,10 +632,7 @@ int npe_initialize(bd_t * bis) sprintf(dev->name, "NPE%d", eth_num); dev->priv = (void *)p_npe; - dev->eo->init = npe_init; - dev->eo->halt = npe_halt; - dev->eo->send = npe_send; - dev->eo->recv = npe_rx; + dev->eo = &npe_ops; p_npe->print_speed = 1;