From patchwork Fri Nov 2 17:18:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196644 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 05F4F2C00D0 for ; Sat, 3 Nov 2012 04:23:01 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9687A4A3C2; Fri, 2 Nov 2012 18:21:22 +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 QTJ8oQbXIhIO; Fri, 2 Nov 2012 18:21:22 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6BAE14A1A8; Fri, 2 Nov 2012 18:19:32 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 780AC4A0F9 for ; Fri, 2 Nov 2012 18:19:18 +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 aa-QKrLZ9KGN for ; Fri, 2 Nov 2012 18:19:17 +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-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id 7D2244A161 for ; Fri, 2 Nov 2012 18:19:02 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625229eaa.3 for ; Fri, 02 Nov 2012 10:19:02 -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=PBpme6oIUxZ8Vm9t1zkw7EcYU30/K12TkE/bp1jwgiI=; b=cqGSY4f1M8+8kNFdWVHhWla/YL4xWT/Su+Rnj7osP9hqzSNzB0lSkySlTPXLDmlP2W 4DMvM1Ci3fVlfKy1tLa0qhJjma9rbqUDFTAezhJPYjRoIHEA1IGUrakPeI7AwNPwwSVb qEAfkxclmQxU217X/xNwOVexAsaHVlT/0SmF0OklD6zVekZlaEghDKETr9wIUMYVEITI UhTFBhDzdBDGMhNkwLh9GQiWIuNQUfv6Eah2RszlKW4ETzBdjfQyLovTQw49j9i2wcql 8xvGEr9pLaW/q/BLeDnUL5+qu2xEwORhW7Sa/0stAoD5qfD+uL3BnC0NTSB3+stEA0MY tkDw== Received: by 10.14.223.4 with SMTP id u4mr8745287eep.19.1351876742305; Fri, 02 Nov 2012 10:19:02 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id b44sm24502736eep.12.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 C76EF46338A; 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:13 +0100 Message-Id: <1351876722-5183-22-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 21/50] net: fec_mxc: 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/fec_mxc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index f8a5556..3259f07 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -915,6 +915,15 @@ static int fec_recv(struct eth_device *dev) return len; } +static struct eth_ops fec_ops = { + .init = fec_init, + .send = fec_send, + .recv = fec_recv, + .halt = fec_halt, + .write_hwaddr = fec_set_hwaddr +}; + + static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) { struct eth_device *edev; @@ -943,11 +952,7 @@ static int fec_probe(bd_t *bd, int dev_id, int phy_id, uint32_t base_addr) memset(fec, 0, sizeof(*fec)); edev->priv = fec; - edev->eo->init = fec_init; - edev->eo->send = fec_send; - edev->eo->recv = fec_recv; - edev->eo->halt = fec_halt; - edev->eo->write_hwaddr = fec_set_hwaddr; + edev->eo = &fec_ops; fec->eth = (struct ethernet_regs *)base_addr; fec->bd = bd;