From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/2] usbnet: use MII hooks only if CONFIG_MII is enabled Date: Sat, 28 Oct 2006 22:13:42 +0100 Message-ID: <20061028211342.GA23360@infradead.org> References: <20061025165858.b76b4fd8.randy.dunlap@oracle.com> <20061028112122.GA14316@infradead.org> <200610281410.13679.david-b@pacbell.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , Randy Dunlap , toralf.foerster@gmx.de, netdev@vger.kernel.org, linux-usb-devel@lists.sourceforge.net, link@miggy.org, greg@kroah.com, akpm@osdl.org, zippel@linux-m68k.org, torvalds@osdl.org, linux-kernel@vger.kernel.org Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:22186 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S964850AbWJ1VNs (ORCPT ); Sat, 28 Oct 2006 17:13:48 -0400 To: David Brownell Content-Disposition: inline In-Reply-To: <200610281410.13679.david-b@pacbell.net> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Sat, Oct 28, 2006 at 02:10:09PM -0700, David Brownell wrote: > On Saturday 28 October 2006 4:21 am, Christoph Hellwig wrote: > > > This is really awkward and against what we do in any other driver. > > Awkward, yes -- which is why I posted the non-awkward version, > which is repeated below. (No thanks to "diff" for making the > patch ugly though; the resulting code is clean and non-awkward, > moving that function helped.) > > Against what other drivers do? Since "usbnet.c" is infrastructure > code, not a driver, your comment can't apply. Infrastructure uses > conditional compilation routinely in such cases. > > But remember that the actual drivers follow the standard convention > ("select MII") given Randy's patch #1 of 2. Ah sorry - I missed that. I still don't quite like the approach. What about simply putting the mii using functions into usbnet-mii.c and let makefile doing all the work? This would require a second set of ethtool ops, but I'd actually consider that a cleanup, as it makes clear which one we're using and allows to kill all the checks for non-mii hardware in the methods.