From patchwork Mon Apr 27 12:16:33 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Rog=C3=A9rio_Brito?= X-Patchwork-Id: 26498 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id CECEAB707C for ; Mon, 27 Apr 2009 22:17:58 +1000 (EST) Received: by ozlabs.org (Postfix) id 82C73DE1AC; Mon, 27 Apr 2009 22:17:43 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 81227DE1AA for ; Mon, 27 Apr 2009 22:17:43 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from smtp.gru.flash.tv.br (smtp.flash.net.br [201.46.240.48]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id D723EDDDF6 for ; Mon, 27 Apr 2009 22:17:22 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by smtp.gru.flash.tv.br (Postfix) with ESMTP id C2BB01E6D04 for ; Mon, 27 Apr 2009 09:16:56 -0300 (BRT) Received: from smtp.gru.flash.tv.br ([127.0.0.1]) by localhost (smtp.gru.flash.tv.br [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mJQ9cVc+pZB9 for ; Mon, 27 Apr 2009 09:16:56 -0300 (BRT) Received: from chagas.nectar.ath.cx (unknown [187.22.248.170]) by smtp.gru.flash.tv.br (Postfix) with ESMTPA id BC9FE1E6D13 for ; Mon, 27 Apr 2009 09:16:50 -0300 (BRT) Received: (qmail 20835 invoked by uid 1000); 27 Apr 2009 12:16:33 -0000 Date: Mon, 27 Apr 2009 09:16:33 -0300 From: =?utf-8?Q?Rog=C3=A9rio?= Brito To: David Miller Subject: [PATCH] powerpc: convert mace to netdev_ops (was: Re: [2.6.30-rc3] powerpc: compilation error of mace module) Message-ID: <20090427121633.GA29608@ime.usp.br> References: <20090426155708.GA23159@ime.usp.br> <20090426.230648.254087966.davem@davemloft.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20090426.230648.254087966.davem@davemloft.net> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: linuxppc-dev@ozlabs.org, paulus@samba.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Hi, Dave. On Apr 26 2009, David Miller wrote: > Or, if you're bored, feel free to convert the mace driver over > to netdev_ops :-) Is this anything close to what needs to be done? It's not without failures, because the function mace_set_timeout receives a pointer to a struct net_device, but is marked inline and is used by mace_tx_timeout, which receives an unsigned long (which calls mace_set_timeout). Perhaps it would be a case of removing the inline hint to the compiler? I guess that BenH or Paul could comment here better... Signed-off-by: Rogério Brito --- a/drivers/net/mace.c 2008-12-29 15:25:15.000000000 -0200 +++ b/drivers/net/mace.c 2009-04-27 08:54:16.000000000 -0300 @@ -89,6 +89,16 @@ static inline void dbdma_reset(volatile static inline void mace_clean_rings(struct mace_data *mp); static void __mace_set_address(struct net_device *dev, void *addr); +/* Conversion to netdev_ops. */ +static const struct net_device_ops mace_netdev_ops = { + .ndo_open = mace_open, + .ndo_stop = mace_close, + .ndo_start_xmit = mace_xmit_start, + .ndo_tx_timeout = mace_set_timeout, + .ndo_set_multicast_list = mace_set_multicast, + .ndo_set_mac_address = mace_set_address, +}; + /* * If we can't get a skbuff when we need it, we use this area for DMA. */ @@ -208,11 +217,7 @@ static int __devinit mace_probe(struct m } } - dev->open = mace_open; - dev->stop = mace_close; - dev->hard_start_xmit = mace_xmit_start; - dev->set_multicast_list = mace_set_multicast; - dev->set_mac_address = mace_set_address; + dev->netdev_ops = &mace_netdev_ops; /* * Most of what is below could be moved to mace_open()