From patchwork Fri Nov 2 17:18:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196646 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 E85932C0084 for ; Sat, 3 Nov 2012 04:23:29 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A5774A101; Fri, 2 Nov 2012 18:21:35 +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 kcx9l4eUVxzr; Fri, 2 Nov 2012 18:21:35 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 794974A15B; Fri, 2 Nov 2012 18:19:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8BCB34A192 for ; Fri, 2 Nov 2012 18:19:15 +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 e+l4SO2Yj+Cs for ; Fri, 2 Nov 2012 18:19:13 +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 C4F444A158 for ; Fri, 2 Nov 2012 18:19:00 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187551eek.3 for ; Fri, 02 Nov 2012 10:19:00 -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=3wyfpGW2ouRjHl8gLwNB6HrEEvwoK/BwiSQ91UncnVM=; b=L9/VNaVTZ9lTKmVwWG9Hp9Go0uiTMFY/Hv1afrleXPCAhwaxDVQE4b+4Xh/PqQQVmu eZlcVmhrOF5TD4CU+xbGAw1UmeTFLD/28qR6JqjheyOGNK1ZoMXa4ZWuZeqpR1bk0vDC ILgxZeaoQ2GAJAlARNSC5QSl9po+dizMRSx7V3WyqWv7GjvYFJ0Kza/NiG/a+WWu88hZ YpnuT4EYNMLKzDXKr1Q9veNDQXt4m9HrbapW1fWebQw/eFXWhVJ4ci7xU0yxa/N/OS+0 8qy+LKl4VtsHS9xVze13zXXV85OQbEQBoFPGOcy1g+OreizsMIVa5rLJtv8EDFv9gp+z lzMw== Received: by 10.14.193.134 with SMTP id k6mr8868422een.15.1351876740675; Fri, 02 Nov 2012 10:19:00 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id e1sm24527053eem.3.2012.11.02.10.18.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:18:59 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 7B54846304C; 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:04 +0100 Message-Id: <1351876722-5183-13-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 12/50] net: davinci_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/davinci_emac.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c index a221092..5701f75 100644 --- a/drivers/net/davinci_emac.c +++ b/drivers/net/davinci_emac.c @@ -769,6 +769,14 @@ static int davinci_eth_rcv_packet (struct eth_device *dev) return (0); } +static struct eth_ops davinci_emac_ops = { + .init = davinci_eth_open, + .halt = davinci_eth_close, + .send = davinci_eth_send_packet, + .recv = davinci_eth_rcv_packet, + .write_hwaddr = davinci_eth_set_mac_addr +}; + /* * This function initializes the emac hardware. It does NOT initialize * EMAC modules power or pin multiplexors, that is done by board_init() @@ -791,11 +799,7 @@ int davinci_emac_initialize(void) sprintf(dev->name, "DaVinci-EMAC"); dev->iobase = 0; - dev->eo->init = davinci_eth_open; - dev->eo->halt = davinci_eth_close; - dev->eo->send = davinci_eth_send_packet; - dev->eo->recv = davinci_eth_rcv_packet; - dev->eo->write_hwaddr = davinci_eth_set_mac_addr; + dev->eo = &davinci_emac_ops; eth_register(dev);