Re: [PATCH 2/2] usbnet: use MII hooks only if CONFIG_MII is enabled

Christoph Hellwig
2006-10-28T21:13:49Z

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.