From patchwork Wed Nov 21 13:23:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200710 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 41C672C007E for ; Thu, 22 Nov 2012 00:28:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 50B034A11D; Wed, 21 Nov 2012 14:28:45 +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 uSLIS3Yk+4wH; Wed, 21 Nov 2012 14:28:44 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4826E4A11E; Wed, 21 Nov 2012 14:27:23 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A0FE44A100 for ; Wed, 21 Nov 2012 14:25:05 +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 hUPeqhV1Yk3P for ; Wed, 21 Nov 2012 14:25:02 +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 527184A097 for ; Wed, 21 Nov 2012 14:24:30 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433757eek.3 for ; Wed, 21 Nov 2012 05:24:30 -0800 (PST) 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=XAFACv4a8GGNRcEpTRuRpHgMQUqQP4ceLjdawL4TliM=; b=aSmRoOWOPoU4bqpIKZB/ixxGE/B15U/Hm5cQ6exY7Q7e6fLIM2EFcr/ROoTCrP2mvg IDuK9ia7PBa4/KlObH+i6xeso6bJ7eq60PnvhlKEHFqiMF4TXlv/DScQ037U92rLcSDP ihQ9vVzgzBpzMAHtJA4gvqdzsFMJO4gMOue/6TAFzPGOxeAIfkxv12lshz3NdhqhcVqK BN0ZlZDR7cBkc5u1HCpZweda92ElGv/tjB3PYtJnbexcGvSaMoGuyVWaeMBfhJTb6VeO Uq/zGFYt1kVCgK0JhcCe9Dfm24wYL0R06V032i/eCLoGxunzK4A53/nEu+6xpA+OxwTS vTnw== Received: by 10.14.175.133 with SMTP id z5mr12534296eel.15.1353504270189; Wed, 21 Nov 2012 05:24:30 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id o47sm179563eem.11.2012.11.21.05.24.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 05:24:29 -0800 (PST) Received: by tapir (Postfix, from userid 2001) id 349E246379E; Wed, 21 Nov 2012 14:24:21 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Wed, 21 Nov 2012 14:23:26 +0100 Message-Id: <1353504238-11277-36-git-send-email-tmshlvck@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1353504238-11277-1-git-send-email-tmshlvck@gmail.com> References: <1351876722-5183-1-git-send-email-tmshlvck@gmail.com> <1353504238-11277-1-git-send-email-tmshlvck@gmail.com> Cc: marex@denx.de Subject: [U-Boot] [PATCH v2 35/67] net: ns8382x: 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/ns8382x.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ns8382x.c b/drivers/net/ns8382x.c index 8b08e0b..c433d3a 100644 --- a/drivers/net/ns8382x.c +++ b/drivers/net/ns8382x.c @@ -294,6 +294,14 @@ OUTL(struct eth_device *dev, int command, u_long addr) *(vu_long *) ((addr + dev->iobase)) = cpu_to_le32(command); } +static struct eth_ops ns8382x_ops = { + .init = ns8382x_init, + .halt = ns8382x_disable, + .send = ns8382x_send, + .recv = ns8382x_poll +}; + + /* Function: ns8382x_initialize * Description: Retrieves the MAC address of the card, and sets up some * globals required by other routines, and initializes the NIC, making it @@ -346,10 +354,7 @@ ns8382x_initialize(bd_t * bis) sprintf(dev->name, "dp8382x#%d", card_number); dev->iobase = bus_to_phys(iobase); dev->priv = (void *) devno; - dev->eo->init = ns8382x_init; - dev->eo->halt = ns8382x_disable; - dev->eo->send = ns8382x_send; - dev->eo->recv = ns8382x_poll; + dev->eo = &ns8382x_ops; /* ns8382x has a non-standard PM control register * in PCI config space. Some boards apparently need