From patchwork Fri Nov 2 17:18:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196674 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 BBDF12C00C4 for ; Sat, 3 Nov 2012 04:30:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 842E34A866; Fri, 2 Nov 2012 18:25: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 AHl3b2dnCK4f; Fri, 2 Nov 2012 18:25:58 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0EB8D4A867; Fri, 2 Nov 2012 18:25:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 87F1A4A834 for ; Fri, 2 Nov 2012 18:25: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 qe32gKxRtQzQ for ; Fri, 2 Nov 2012 18:25:08 +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 350974A828 for ; Fri, 2 Nov 2012 18:25:08 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2190477eek.3 for ; Fri, 02 Nov 2012 10:25:08 -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=HRk5Glpt5Y/A3CF6eHIKOFpLqqMNuJndSjn2Myvnu84=; b=vos1FsZK414OFcQa4gMAU1maapS6qzdlpoPAILkMRAjYcsG8fruAOyPgBah0icUA11 04AiUksszj/VDDPaC+zrhfKS6rt7SNZJIeaGaVzrUCNw9bkIeX8P54clwYRrBJCAJ5sg /0w+/HyMF7KaZZ/IWV8EkNtoButUVLnIyyki0wqNWE5j9BAW2eDnqa+xSODZcW2YDTM6 eUyM/NI+K2w7o5H5b3tlxlgaJgjU0Y4VYo6g347a/E0EEXG29QP3v4QpAx1kCFZH9YRZ WCI/ulIWdFhNDOzH8XpCmo4y3jgfeZmZm15yK8Am8swViB021tT2skoJ21tzfjlO6m2m oFIA== Received: by 10.14.174.194 with SMTP id x42mr8899744eel.22.1351877108015; Fri, 02 Nov 2012 10:25:08 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id 42sm24573852eee.0.2012.11.02.10.25.05 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:25:06 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 0B44E463523; 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:21 +0100 Message-Id: <1351876722-5183-30-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 29/50] net: mcffec: 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/mcffec.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/mcffec.c b/drivers/net/mcffec.c index 0aeb24e..31c8dcd 100644 --- a/drivers/net/mcffec.c +++ b/drivers/net/mcffec.c @@ -551,6 +551,13 @@ void fec_halt(struct eth_device *dev) memset(info->txbuf, 0, DBUF_LENGTH); } +static struct eth_ops fec_ops = { + .init = fec_init, + .halt = fec_halt, + .send = fec_send, + .recv = fec_recv +}; + int mcffec_initialize(bd_t * bis) { struct eth_device *dev; @@ -572,10 +579,7 @@ int mcffec_initialize(bd_t * bis) sprintf(dev->name, "FEC%d", fec_info[i].index); dev->priv = &fec_info[i]; - dev->eo->init = fec_init; - dev->eo->halt = fec_halt; - dev->eo->send = fec_send; - dev->eo->recv = fec_recv; + dev->eo = &fec_ops; /* setup Receive and Transmit buffer descriptor */ #ifdef CONFIG_SYS_FEC_BUF_USE_SRAM