From patchwork Wed Nov 21 13:23:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200724 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 062082C0093 for ; Thu, 22 Nov 2012 00:31:08 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AAA254A260; Wed, 21 Nov 2012 14:30:09 +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 R6TRhoY8BYB5; Wed, 21 Nov 2012 14:30:09 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B57804A158; Wed, 21 Nov 2012 14:27:35 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A9C424A09E for ; Wed, 21 Nov 2012 14: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 jKNwzaYHZfvh for ; Wed, 21 Nov 2012 14:25:11 +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 AC43B4A0AA for ; Wed, 21 Nov 2012 14:24:32 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433879eek.3 for ; Wed, 21 Nov 2012 05:24:32 -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=XESZN/SgeOvqzt5po1rhb9bxifOwsO2spnlonDF4olY=; b=I6BVDfVz0A3HYAx63VjvpQsPnL81yo72JJGGfyN2BTdi4T1EIzE8v6yE/GQQVSC61l +df/qhX8vouApvE5aK2QQTWqR2l0Kf3LD7CZ0Wiv2E2XReHPr4p1C+sm1FMB0+aKR6tj BhoSaig/EniFl70MlkqajSd3TzhgEkGKzj875RGhPMaT9D6yXMKAsfAmzvY39LskVgsk UFXyXWd/78oHkvDKHQ2+PP+dlb6lo9KwpNZ26bLXvWLqaicapqHbzhvdYMu5rJHd3wQP ZqwdvrxVo8FftPYuLHzMmQAXW3vp+mudxYWKodBxUDFunlSiRt/7LOVcIIMv7g2T5m2C HnCA== Received: by 10.14.176.68 with SMTP id a44mr45763329eem.1.1353504272582; Wed, 21 Nov 2012 05:24:32 -0800 (PST) Received: from tapir ([89.177.24.237]) by mx.google.com with ESMTPS id g47sm203626eeo.6.2012.11.21.05.24.30 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:32 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 59B0F4637BD; 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:31 +0100 Message-Id: <1353504238-11277-41-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 40/67] 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 files 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);