From patchwork Fri Nov 2 17:18:17 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196658 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 72C592C00D0 for ; Sat, 3 Nov 2012 04:25:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 79A7D4A5EB; Fri, 2 Nov 2012 18:22:38 +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 uh6xV7f6S4ig; Fri, 2 Nov 2012 18:22:38 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE6644A1F0; Fri, 2 Nov 2012 18:19:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9FD8A4A199 for ; Fri, 2 Nov 2012 18:19:27 +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 jCmj27TmMsxh for ; Fri, 2 Nov 2012 18:19:24 +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 A8E5D4A155 for ; Fri, 2 Nov 2012 18:19:04 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187556eek.3 for ; Fri, 02 Nov 2012 10:19:04 -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=HK1AOh2bx0EAFPQujCa4bs7F50t59iE89RDWdY1CvK0=; b=r8ysdUvDfTugAZAIwn8s/Mw2llMhOdE7FOHqTS94UgWuWljusmBsOe42EQiyU6uEV5 ofcycnfBaJDkO5dSZr9PHa7MKetXz41JqhksUEcBLbOZblQpTXwBk3V1yqHiwgOXsIF5 as+LWM93KuU0avlJSVudBT70fVJZHhImm508mnutprACbBqolmYHw1muu76xf4vpiQwv INFq2KGZCAxZJT5KHK7/GvPp3MAekqBMdUxFO2EQVAM3PAXDwHV8okCSPpPXuQxMTfpq 2h/QDJ5W5ZbqtkT3ADb58Rr4GedsgZeT9AeiOgwJWJBU6olkJ6nqg0rJOFBiF5Xea+2y DLeA== Received: by 10.14.203.132 with SMTP id f4mr8907684eeo.11.1351876744560; Fri, 02 Nov 2012 10:19:04 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id g47sm24519859eeo.6.2012.11.02.10.19.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id E4EC046350A; 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:17 +0100 Message-Id: <1351876722-5183-26-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 25/50] net: inca-ip_sw: 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/inca-ip_sw.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/inca-ip_sw.c b/drivers/net/inca-ip_sw.c index 216122d..ab91553 100644 --- a/drivers/net/inca-ip_sw.c +++ b/drivers/net/inca-ip_sw.c @@ -165,6 +165,12 @@ static void inca_init_switch_chip(void); static void inca_dma_init(void); static int inca_amdix(void); +static struct eth_ops inca_switch_ops = { + .init = inca_switch_init, + .halt = inca_switch_halt, + .send = inca_switch_send, + .recv = inca_switch_recv +}; int inca_switch_initialize(bd_t * bis) { @@ -189,10 +195,7 @@ int inca_switch_initialize(bd_t * bis) #endif sprintf(dev->name, "INCA-IP Switch"); - dev->eo->init = inca_switch_init; - dev->eo->halt = inca_switch_halt; - dev->eo->send = inca_switch_send; - dev->eo->recv = inca_switch_recv; + dev->eo = &inca_switch_ops; eth_register(dev);