From patchwork Fri Nov 2 17:18:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 196662 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 1115F2C00C4 for ; Sat, 3 Nov 2012 04:27:06 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1A1D14A0C1; Fri, 2 Nov 2012 18:23: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 JEcgl9cQLckT; Fri, 2 Nov 2012 18:23:08 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F2AB84A227; Fri, 2 Nov 2012 18:20:02 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4ECF44A1B1 for ; Fri, 2 Nov 2012 18:19:34 +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 P9Tqinf0iJQA for ; Fri, 2 Nov 2012 18:19:28 +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 AAE3A4A101 for ; Fri, 2 Nov 2012 18:19:05 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id d4so2187556eek.3 for ; Fri, 02 Nov 2012 10:19:05 -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=wM4rU9qu/ta8oKVbj/VHRfvo/jLjELYjgnnDnWscOY4=; b=RPe90OaoGT12U08f5KyCzOIqVzNbDjQvcnN098X/xM8Fh+lewEjpPsL1FCDWjXyCvN QkJYpIQxWdaHFpK49FDlFTqWQrqE9ObwLOV92HbtWstuHuEL4/2Scb+883tnVMctkesz MWxZk/kIgjctInlBd1KLKOvx1PMVc/jtvIILPKHSHSlI1PEknU1mQ5TH7fFM19kl4h2E ZYQUcgyfF6QXwDpL8NsCQqIo6MCN7JkN/xlLBNO0UB8TiDkYyuuhwo3o0jZQgpTVEWmc 4zQ8hTrTaLAvRLadXmhG7907koso+PAHxIEJrOVkbzmrHBa2IgdmIX4QcYWexm8k5cBZ Ydgg== Received: by 10.14.184.1 with SMTP id r1mr8972600eem.4.1351876745504; Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: from tapir ([217.31.207.1]) by mx.google.com with ESMTPS id s1sm24508340eem.9.2012.11.02.10.19.03 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 02 Nov 2012 10:19:05 -0700 (PDT) Received: by tapir (Postfix, from userid 2001) id 6570F4635C0; Fri, 2 Nov 2012 18:18:55 +0100 (CET) From: Tomas Hlavacek To: u-boot@lists.denx.de Date: Fri, 2 Nov 2012 18:18:34 +0100 Message-Id: <1351876722-5183-43-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 42/50] net: smc911x: 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/smc911x.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 5ba1bdf..0369376 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -251,6 +251,13 @@ static int smc911x_miiphy_write(const char *devname, u8 phy, u8 reg, u16 val) } #endif +static struct eth_ops smc911x_ops = { + .init = smc911x_init, + .halt = smc911x_halt, + .send = smc911x_send, + .recv = smc911x_rx +}; + int smc911x_initialize(u8 dev_num, int base_addr) { unsigned long addrl, addrh; @@ -282,10 +289,7 @@ int smc911x_initialize(u8 dev_num, int base_addr) dev->enetaddr[5] = addrh >> 8; } - dev->eo->init = smc911x_init; - dev->eo->halt = smc911x_halt; - dev->eo->send = smc911x_send; - dev->eo->recv = smc911x_rx; + dev->eo = &smc911x_ops; sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num); eth_register(dev);