From patchwork Fri Nov 2 17:18:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196645 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 5C6752C00C4 for ; Sat, 3 Nov 2012 04:23:14 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A16404A15E; Fri, 2 Nov 2012 18:21:28 +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 mmFsifvj0JIt; Fri, 2 Nov 2012 18:21:28 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BDA84A1AD; Fri, 2 Nov 2012 18:19:33 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2DB2F4A154 for ; Fri, 2 Nov 2012 18:19:17 +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 7TFtMmw63zRb for ; Fri, 2 Nov 2012 18:19:15 +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 D2FA04A151 for ; Fri, 2 Nov 2012 18:19:01 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187556eek.3 for ; Fri, 02 Nov 2012 10:19:01 -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=6IPrAoHiT7h3zbPXh82lA89MMFVU5GVL4w2ZGBnHgaE=; b=XpBCganKbDNExIREwO1ZlZ1k+yjGwZGjL8qnlxUh5P68QG4Bbhg8TA5SyCIhWO+l4x 9kzcflOzPbwsPv2/yVsLNUFjJ/M3ixndmdfrcqzT3Yk9E6U1m0Bfn08xKVnTLRjLkeB6 Tm50bj6Ca1i2NAZrH8ZZr8Yh5Rxrp3B4SFxb4n9krllfDHmCFmrHimNrYJopmK2Hd9MH WEbQh0GIy2TKQBePd5/pJ/e/ETh8C6ME9d2XFyjcRcecOPcXR4QE5JpgCAX+cEwDve5G FQL17j2SeeffZUtDdeGP3iCjJhwn/1ffgxrnelS4+bVw9irTbv3sJclP8q1XZmxoBK/S aWoQ== Received: by 10.14.174.194 with SMTP id x42mr8846534eel.22.1351876741671; Fri, 02 Nov 2012 10:19:01 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id g47sm24519622eeo.6.2012.11.02.10.18.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:00 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id AD92C463271; 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:10 +0100 Message-Id: <1351876722-5183-19-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 18/50] net: enc28j60: 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/enc28j60.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c index 95f0b93..e73fef8 100644 --- a/drivers/net/enc28j60.c +++ b/drivers/net/enc28j60.c @@ -924,6 +924,14 @@ static void enc_halt(struct eth_device *dev) enc_release_bus(enc); } +static struct eth_ops enc28j60_ops = { + init = enc_init, + halt = enc_halt, + send = enc_send, + recv = enc_recv, + write_hwaddr = enc_write_hwaddr +}; + /* * This is the only exported function. * @@ -962,11 +970,7 @@ int enc28j60_initialize(unsigned int bus, unsigned int cs, enc->dev = dev; /* now fill the eth_device object */ dev->priv = enc; - dev->eo->init = enc_init; - dev->eo->halt = enc_halt; - dev->eo->send = enc_send; - dev->eo->recv = enc_recv; - dev->eo->write_hwaddr = enc_write_hwaddr; + dev->eo = &enc28j60_ops; sprintf(dev->name, "enc%i.%i", bus, cs); eth_register(dev); #if defined(CONFIG_CMD_MII)