From patchwork Fri Nov 2 17:18:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196656 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 662482C00C8 for ; Sat, 3 Nov 2012 04:25:15 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA6594A589; Fri, 2 Nov 2012 18:22:25 +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 R2S7If416TNz; Fri, 2 Nov 2012 18:22:25 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 040D74A1E5; 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 EEEF04A192 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 VJcY-midI5E4 for ; Fri, 2 Nov 2012 18:19:26 +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 12B884A0F5 for ; Fri, 2 Nov 2012 18:19:04 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187547eek.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=ISX5jL56+Fhx/FGqCzmD/ACmK/NW+FHWsj3Rob8lD+k=; b=h313zlvGjuEZ6EoXknEWUCjkHIUH2KMu4a3ktPqyCHlGUNKQoElIRw9/0fPNNDOTui APv4pkq0T2R4s6ZSWGQh79/8F3cvFT1oH1EPbChurga5bjGbtqZ4o9GRkQLFpew7iVyO bUpaSeCEo2eoQ/FT2F5GOvR2DqzDCRoFYsUANjFyC3CkRVwIu2ib2STP6ODyANShikCo rdpZg2256q09K5REz2TejdXVQa8EzykzarNYALAfSS97GDSMOKOyzk3fpmmlvt2TAwvP 5TBE+sEeQACMNBsU/+2WqfDmOGXz1BQy0IFHbWJrGUPFfsKhlXvPm/tghNp9yUhNbmku Ti5g== Received: by 10.14.213.65 with SMTP id z41mr8671279eeo.29.1351876744887; 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 a44sm24515650eeo.7.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 F238E46351B; 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:19 +0100 Message-Id: <1351876722-5183-28-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 27/50] net: lan91c96: 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/lan91c96.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/lan91c96.c b/drivers/net/lan91c96.c index d87302b..4e4e2e4 100644 --- a/drivers/net/lan91c96.c +++ b/drivers/net/lan91c96.c @@ -785,6 +785,13 @@ static int lan91c96_detect_chip(struct eth_device *dev) return 0; } +static struct eth_ops lan91c96_ops = { + .init = lan91c96_init, + .halt = lan91c96_halt, + .send = lan91c96_send, + .recv = lan91c96_recv +}; + int lan91c96_initialize(u8 dev_num, int base_addr) { struct eth_device *dev; @@ -806,10 +813,7 @@ int lan91c96_initialize(u8 dev_num, int base_addr) } get_rom_mac(dev, dev->enetaddr); - dev->eo->init = lan91c96_init; - dev->eo->halt = lan91c96_halt; - dev->eo->send = lan91c96_send; - dev->eo->recv = lan91c96_recv; + dev->eo = &lan91c96_ops; sprintf(dev->name, "%s-%hu", supported_chips[r].name, dev_num); eth_register(dev);