From patchwork Fri Nov 2 17:17:58 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196633 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 BA15E2C00C4 for ; Sat, 3 Nov 2012 04:20:25 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C34E34A14C; Fri, 2 Nov 2012 18:20: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 3hApowfRmb-T; Fri, 2 Nov 2012 18:20:11 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 702874A189; Fri, 2 Nov 2012 18:19:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 870F54A184 for ; Fri, 2 Nov 2012 18:19: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 Ehmn8pK-pYfw for ; Fri, 2 Nov 2012 18:19: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-ea0-f172.google.com (mail-ea0-f172.google.com [209.85.215.172]) by theia.denx.de (Postfix) with ESMTPS id D5D1A4A11E for ; Fri, 2 Nov 2012 18:18:58 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625264eaa.3 for ; Fri, 02 Nov 2012 10:18:58 -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=svaMuB5xzU9/yVSXBLBauhyKDXm9NOH7oOpuov6NrX4=; b=UHIi+EuVHP+unozPWjlkP1Y90ZIKUp8Hhu0J00Lly+0v2WVnkgZGkV+n1phByqEQeQ /n5gcWT6Hj+V269q1R73HqZcfOpQPAQ6V00g15aI9K8PJCt91X7vD49n+hxnYhO5bNXF lguN+7s+BjNU+LSaWcIU0CnD4uIl8PSZ9bOe2L2+5YNDV9HtN4XEVXMkwIPyTZnNxpD6 wsrZLbKvsQMUJXG+ZK7L08V5//De9vg1gQOJn/45zN6Yt8WoatDnyrANXY31m99e8BrS bI5x+0a+l37PeubYiO4q0iZCRjvHVN+a/vhOxWLR/h8RrOgUVwlW3hQF2j8TJ7b2gj/N 7m9w== Received: by 10.14.220.71 with SMTP id n47mr8760430eep.26.1351876738463; Fri, 02 Nov 2012 10:18:58 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id a44sm24515120eeo.7.2012.11.02.10.18.57 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:18:57 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 4CE4F461EB8; Fri, 2 Nov 2012 18:18:54 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:17:58 +0100 Message-Id: <1351876722-5183-7-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 06/50] net: at91_emac: 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/at91_emac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/at91_emac.c b/drivers/net/at91_emac.c index 3395dcc..464d539 100644 --- a/drivers/net/at91_emac.c +++ b/drivers/net/at91_emac.c @@ -494,6 +494,14 @@ static int at91emac_write_hwaddr(struct eth_device *netdev) return 0; } +static struct eth_ops at91emac_ops = { + .init = at91emac_init, + .halt = at91emac_halt, + .send = at91emac_send, + .recv = at91emac_recv, + .write_hwaddr = at91emac_write_hwaddr +}; + int at91emac_register(bd_t *bis, unsigned long iobase) { emac_device *emac; @@ -518,11 +526,7 @@ int at91emac_register(bd_t *bis, unsigned long iobase) sprintf(dev->name, "emac"); dev->iobase = iobase; dev->priv = emacfix; - dev->eo->init = at91emac_init; - dev->eo->halt = at91emac_halt; - dev->eo->send = at91emac_send; - dev->eo->recv = at91emac_recv; - dev->eo->write_hwaddr = at91emac_write_hwaddr; + dev->eo = &at91emac_ops; eth_register(dev);