From patchwork Wed Nov 21 13:23:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Hlavacek X-Patchwork-Id: 200707 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 6AF0B2C00A5 for ; Thu, 22 Nov 2012 00:28:26 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 96F794A0EF; Wed, 21 Nov 2012 14:28: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 j1qucOu3+Xxn; Wed, 21 Nov 2012 14:28:16 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 56D4D4A104; Wed, 21 Nov 2012 14:27:20 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2A6794A0F5 for ; Wed, 21 Nov 2012 14:25:04 +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 BLqRXIC-7a9x for ; Wed, 21 Nov 2012 14:25:03 +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 C4D264A09C for ; Wed, 21 Nov 2012 14:24:30 +0100 (CET) Received: by mail-ee0-f44.google.com with SMTP id b47so4433819eek.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=fbL53FnZB95B8SYXdcpAlmHONuZr3kxvCfNiMq8Hjdg=; b=zUneKKWOF6Z4Z6rD+UzFXcoF3XjdQnhAj+lilBPA8mvb61oCYhoixAy+VgK8gVW52A dpSaU9UFVWKhxV5gi8vbjaxb09sBoFl1DHFIOpeWk9rZwrMMoep1ZegYl56bFJur5qDI STcebpq7N77dIuF2nyAFQDqVPH8RmKmNMdLZ6B3Aao7V0qwLTB1B6VRrB2FT1wj7uVK3 On4A+paPVnogbPfm0OQDwvoU2B7nTp+AhAZ7AT/Nxkgjs1zNzQTxwL7vLPtBP4uNAj2r ID+UIM75H0Hl3rQNKLch+YpoXQBRbGJh1yRsSwStwqAm+715o9IOI3tuBzL78JG+0IMU D4pQ== Received: by 10.14.221.5 with SMTP id q5mr11339755eep.33.1353504270683; Wed, 21 Nov 2012 05:24:30 -0800 (PST) Received: from tapir ([2001:1ab0:b101::1003]) by mx.google.com with ESMTPS id k2sm157302eep.15.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 10763463785; 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:21 +0100 Message-Id: <1353504238-11277-31-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 30/67] net: mvgbe: 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/mvgbe.c | 14 +++++++++----- 1 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/mvgbe.c b/drivers/net/mvgbe.c index 6ddb6d6..eeb0741 100644 --- a/drivers/net/mvgbe.c +++ b/drivers/net/mvgbe.c @@ -647,6 +647,14 @@ static int mvgbe_recv(struct eth_device *dev) return 0; } +static struct eth_ops mvgbe_ops = { + .init = (int (*) (struct eth_device *, bd_t *))mvgbe_init, + .halt = (void (*) (struct eth_device *))mvgbe_halt, + .send = mvgbe_send, + .recv = mvgbe_recv, + .write_hwaddr = mvgbe_write_hwaddr +}; + int mvgbe_initialize(bd_t *bis) { struct mvgbe_device *dmvgbe; @@ -721,11 +729,7 @@ error1: return -1; } - dev->eo->init = (void *)mvgbe_init; - dev->eo->halt = (void *)mvgbe_halt; - dev->eo->send = (void *)mvgbe_send; - dev->eo->recv = (void *)mvgbe_recv; - dev->eo->write_hwaddr = (void *)mvgbe_write_hwaddr; + dev->eo = &mvgbe_ops; eth_register(dev);