From patchwork Fri Nov 2 17:18:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196668 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 6A8872C00B0 for ; Sat, 3 Nov 2012 04:29:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E79D24A83E; Fri, 2 Nov 2012 18:25:11 +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 zJijPIunCl5z; Fri, 2 Nov 2012 18:25:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CB4824A82E; Fri, 2 Nov 2012 18:25:08 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CC5BB4A829 for ; Fri, 2 Nov 2012 18:25:06 +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 IOAELrVmn9Yb for ; Fri, 2 Nov 2012 18:25:06 +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 370704A828 for ; Fri, 2 Nov 2012 18:25:05 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2190477eek.3 for ; Fri, 02 Nov 2012 10:25: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=NRSCs7DjL82aFKz1uhCFno7GCD7zPChkwWnFUE54aL8=; b=Uyq7fWxHiPLPkRM3/hIVOh+hDaOvmDFb94P1cL0q+frPCDhsgq9MrwqkeuAKo8CpYH XLk45t8mimHDNXylN2dE6Jjo/oSQiBcW4EgHxiiFsdT10DMryXeh+08voSOLm5TKvnnJ QdztD0bwcH0vk4Rkd7aZD6ZeOoUfoV/ktP9cl6fRnpZOzovThGtBWg5Y2xOlldEWNqYb 1pD3DaJ/IxSjPHC2o2NXv/Tt//mvpWUeevPcgTE+8TqOTwqd82LGpSoFWBH4zCk3LFl8 g7ACmGorhz00Jr5I9YQNO/G0eIyK8hZlEE9iJXblgE8KR5s1HwMoDFWFobKeQfV14rIS a9aA== Received: by 10.14.175.71 with SMTP id y47mr8741898eel.36.1351877104552; Fri, 02 Nov 2012 10:25:04 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id d44sm24548327eeo.10.2012.11.02.10.25.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:25:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 5D7794635BD; Fri, 2 Nov 2012 18:18:55 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:18:33 +0100 Message-Id: <1351876722-5183-42-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 41/50] net: smc91111: 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/smc91111.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/smc91111.c b/drivers/net/smc91111.c index 3ea7213..f237ef8 100644 --- a/drivers/net/smc91111.c +++ b/drivers/net/smc91111.c @@ -1331,6 +1331,14 @@ static void print_packet( byte * buf, int length ) } #endif +static struct eth_ops smc_ops = { + .init = smc_init, + .halt = smc_halt, + .send = smc_send, + .recv = smc_rcv, + .write_hwaddr = smc_write_hwaddr +}; + int smc91111_initialize(u8 dev_num, int base_addr) { struct smc91111_priv *priv; @@ -1357,11 +1365,7 @@ int smc91111_initialize(u8 dev_num, int base_addr) dev->enetaddr[i] = SMC_inb(dev, (ADDR0_REG + i)); swap_to(FLASH); - dev->eo->init = smc_init; - dev->eo->halt = smc_halt; - dev->eo->send = smc_send; - dev->eo->recv = smc_rcv; - dev->eo->write_hwaddr = smc_write_hwaddr; + dev->eo = &smc_ops; sprintf(dev->name, "%s-%hu", SMC_DEV_NAME, dev_num); eth_register(dev);