From patchwork Fri Nov 2 17:18:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196643 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 ADCB12C0084 for ; Sat, 3 Nov 2012 04:22:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 479A84A199; Fri, 2 Nov 2012 18:21:16 +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 4fQQAJLeczJJ; Fri, 2 Nov 2012 18:21:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 83E854A1A4; Fri, 2 Nov 2012 18:19:31 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E08484A0F9 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 vaEGJddND7DG 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 3C78D4A15F for ; Fri, 2 Nov 2012 18:19:02 +0100 (CET) Received: by mail-ea0-f172.google.com with SMTP id k13so1625261eaa.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=m7EwHeZPyeWcY7uho/hjMhEkQKr3unrDO31wEMXeLEw=; b=EFTSf7ZQItH2Al3Xa3WqMquY7pFtqkGtjxqTVVlASVzOi9GqehzTMk9Y/XLvy3QXUx ppCsr0XHUV63H45KGooPD5trdan+nUQ4+KJfvkwwn0nqs4zarog94hFC6fdArV4qvBLP g0cujGbRb8yZGcM1+v69+DV/yBEHWg6ixAhNyCIuaU2HJ0uhRiMmlaLy3jedp2aJAtde r9A1Mbfq/XDpZqffOe0tr76Dazwvx/NXBacDix0H9sfJjI1daJVRTlyQlDy0jJR+Gbh2 r6Twz70g+rTP8gCGlXZ+H+EGV43gF5bz1FJjBhq0WMNDiwVXbPm6dl1zHeSvvZvdzz/R x55Q== Received: by 10.14.223.199 with SMTP id v47mr8654150eep.45.1351876742067; Fri, 02 Nov 2012 10:19:02 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id t7sm24499770eel.14.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 BE76346337C; 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:12 +0100 Message-Id: <1351876722-5183-21-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 20/50] net: ethoc: 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/ethoc.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c index 946b8e2..6a78605 100644 --- a/drivers/net/ethoc.c +++ b/drivers/net/ethoc.c @@ -482,6 +482,14 @@ static int ethoc_recv(struct eth_device *dev) return 0; } +static struct eth_ops ethoc_ops = { + .init = ethoc_init, + .halt = ethoc_halt, + .send = ethoc_send, + .recv = ethoc_recv, + .write_hwaddr = ethoc_set_mac_address +}; + int ethoc_initialize(u8 dev_num, int base_addr) { struct ethoc *priv; @@ -499,11 +507,7 @@ int ethoc_initialize(u8 dev_num, int base_addr) memset(dev, 0, sizeof(*dev)); dev->priv = priv; dev->iobase = base_addr; - dev->eo->init = ethoc_init; - dev->eo->halt = ethoc_halt; - dev->eo->send = ethoc_send; - dev->eo->recv = ethoc_recv; - dev->eo->write_hwaddr = ethoc_set_mac_address; + dev->eo = ðoc_ops; sprintf(dev->name, "%s-%hu", "ETHOC", dev_num); eth_register(dev);