From patchwork Wed Nov 21 13:23:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200693 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 D92D82C007E for ; Thu, 22 Nov 2012 00:26:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 967C24A02D; Wed, 21 Nov 2012 14:25:55 +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 UQu2VK46bQTG; Wed, 21 Nov 2012 14:25:55 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0846C4A04B; Wed, 21 Nov 2012 14:24:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A2E394A041 for ; Wed, 21 Nov 2012 14:24:40 +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 58p2PNzcpChK for ; Wed, 21 Nov 2012 14:24:39 +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 CEF1C4A044 for ; Wed, 21 Nov 2012 14:24:25 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433819eek.3 for ; Wed, 21 Nov 2012 05:24:25 -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=WHr+zHigUhSNP9F/M7sOcqtWOeomYjkJVbR44Itn0Gc=; b=NVx1HpJ4bnI2bskCEk1oQiD3QX8BbbnzmWk79Y6T/fiM1Im7lqg7CDskaQJQNzwlzn /Ky2g5YcdJgGMV6n7kBWCmYZ0T9WDLM8jF6No56Y04fkpgQ+mLEd87keHShbc1o6P/0T 8I0R7rE03iOxMwZc5Vw+GhG9AViJOV9B3mfHgCg2WJOywTKEarxRevi9tl41H0pmITwn SJosLlvIIVb81jolNBxfWjQ1lRibagW0Dlw1F6h9i7fSGkXtOEVbMwrAqlH+D/SZhB4B pXdh61dqKyPwmhb8lzdeF688Nao6K40SQEMrOflgXZYMlfuoczRRMd4uiUrOn7QP1bGr RkTQ== Received: by 10.14.209.201 with SMTP id s49mr45789931eeo.7.1353504265499; Wed, 21 Nov 2012 05:24:25 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id f2sm222385eep.2.2012.11.21.05.24.24 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:24 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 7678546362E; 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:01 +0100 Message-Id: <1353504238-11277-11-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 10/67] net: cs8900: 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/cs8900.c | 12 ++++++++---- 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/cs8900.c b/drivers/net/cs8900.c index 65a4254..a78eada 100644 --- a/drivers/net/cs8900.c +++ b/drivers/net/cs8900.c @@ -299,6 +299,13 @@ int cs8900_e2prom_write(struct eth_device *dev, u8 addr, u16 value) return 0; } +static struct eth_ops cs8900_ops = { + .init = cs8900_init, + .halt = cs8900_halt, + .send = cs8900_send, + .recv = cs8900_recv +}; + int cs8900_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -320,10 +327,7 @@ int cs8900_initialize(u8 dev_num, int base_addr) dev->iobase = base_addr; dev->priv = priv; - dev->eo->init = cs8900_init; - dev->eo->halt = cs8900_halt; - dev->eo->send = cs8900_send; - dev->eo->recv = cs8900_recv; + dev->eo = &cs8900_ops; /* Load MAC address from EEPROM */ cs8900_get_enetaddr(dev);