From patchwork Wed Nov 21 13:23:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200735 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 E21AF2C00A5 for ; Thu, 22 Nov 2012 00:33:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 696304A19A; Wed, 21 Nov 2012 14:31:21 +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 ehd0UmvbqRyP; Wed, 21 Nov 2012 14:31:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6369D4A19D; Wed, 21 Nov 2012 14:27:46 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5BD954A0F1 for ; Wed, 21 Nov 2012 14:24:58 +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 s-ZdyX34JWpV for ; Wed, 21 Nov 2012 14:24:56 +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 45AE04A092 for ; Wed, 21 Nov 2012 14:24:29 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433803eek.3 for ; Wed, 21 Nov 2012 05:24:29 -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=fQWDTe1W+nhnlyWN9JlIAiILjmMdQ9AccJsWB6+1SXE=; b=pjFSXrCeMb4yv5w+zByzi5gXlSkY2ao13/IBa2Oh4YmZFTTn2qArgTyUAer2lnKt6O til7lg3jvWoyxV9xXooYCE5LAX/02xCqephIos4wbgnWi9P5xQemVH0HTI8PSKxRtRP7 5KMH26r6zsdo4A60B2ckvP8s4t5P6Nndd4YyGZeprZYDLRpqGJW4arNxmQzRagJx5ufZ OnTEmwrSPXXm7Rn57TySWSeU9auD2LU26NQnbtCluoRmAtvHRBNFidR7ISJ9EoH0VqZK td3AFI3wvqc/CTjNkoWteXIMqnnIFYlkjK3ThZ4HORT8XmGDmSjCBbYb5W3LveCvHb26 EsNg== Received: by 10.14.223.135 with SMTP id v7mr45293452eep.41.1353504269184; Wed, 21 Nov 2012 05:24:29 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id 46sm214819eeg.4.2012.11.21.05.24.27 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:28 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id DA339463734; 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:15 +0100 Message-Id: <1353504238-11277-25-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 24/67] 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 files 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);