From patchwork Fri Nov 2 17:18:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196657 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 E6BC92C00C8 for ; Sat, 3 Nov 2012 04:25:31 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F8704A5BD; Fri, 2 Nov 2012 18:22:32 +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 EyJA32y+uQXS; Fri, 2 Nov 2012 18:22:32 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3FEF4A1E2; Fri, 2 Nov 2012 18:19:43 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 218334A170 for ; Fri, 2 Nov 2012 18:19:26 +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 XWndRY6LavSv for ; Fri, 2 Nov 2012 18:19:25 +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 E2D9B4A174 for ; Fri, 2 Nov 2012 18:19:04 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187551eek.3 for ; Fri, 02 Nov 2012 10:19:04 -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=+eiGXIhTvfXic4y5yjDSj/iczz9yzGwJY8C4B3PI6jc=; b=Zi7WtyGMcOJ6pCpE7MjxrpdI1zjhYmeJk+D8pIeDRPCQoxMV5HWZXxBYCX2gqzMEUm heeraHQ76T41qzCxPRDE5STwoE2/2Eam9DQ6dvDvlH/tyyABqfgNB83He+TY1McvVwBc f1g4Zc7euDfiGxrmciFVh0tAA+nwl31H+rS+/0LY8UcdN+ZM9Dc4pNAxX8cpcsjMJnL7 Vj90NCvOz99BZ0ruQyfNNROmon/gPWnugnJCRbr8SapHvJ4f0PUq00/1OgUjc+axWTSr r+nICgVIr7zKgroJM0TUIfjOVWKFrMHhVK8eD74Wl3h5PMtGjh6dFnvcr9bTr9O84EMN Mjhw== Received: by 10.14.221.8 with SMTP id q8mr8759151eep.28.1351876744737; Fri, 02 Nov 2012 10:19:04 -0700 (PDT) Received: from tapir ([2001:1488:ac14:1400:224:7eff:fe6e:2518]) by mx.google.com with ESMTPS id i1sm24512384eeo.8.2012.11.02.10.19.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:03 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 045B7463521; 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:20 +0100 Message-Id: <1351876722-5183-29-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 28/50] net: macb: 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/macb.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 2c53902..c0f1202 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -529,6 +529,14 @@ static int macb_write_hwaddr(struct eth_device *dev) return 0; } +static struct eth_ops macb_ops = { + .init = macb_init, + .halt = macb_halt, + .send = macb_send, + .recv = macb_recv, + .write_hwaddr = macb_write_hwaddr +}; + int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) { struct macb_device *macb; @@ -558,11 +566,7 @@ int macb_eth_initialize(int id, void *regs, unsigned int phy_addr) macb->phy_addr = phy_addr; sprintf(netdev->name, "macb%d", id); - netdev->eo->init = macb_init; - netdev->eo->halt = macb_halt; - netdev->eo->send = macb_send; - netdev->eo->recv = macb_recv; - netdev->eo->write_hwaddr = macb_write_hwaddr; + netdev->eo = &macb_ops; /* * Do some basic initialization so that we at least can talk