[U-Boot-Users] RFC: miiphy changes

Haavard Skinnemoen hskinnemoen at gmail.com
Sat Jan 20 13:34:47 CET 2007

On 1/20/07, Ben Warren <bwarren at qstreams.com> wrote:
> None of the implementations in the U-boot tree make
> use of the 'char *devname' parameter, and I'd like to
> change it to a more useful pointer.  Not knowing the
> history of this code, I'm wary of unintended
> consequences.  I'd obviously prefer to not break
> anybody's out-of-tree code, but that can never be
> guaranteed.

Don't know what you mean by a "more useful" pointer, but I think the
idea is good. I have an out-of-tree ethernet driver supporting
multiple interfaces, and one of the things I've been wondering about
is how to know which of the two I'm supposed to use for the MII stuff.

Looking at the code again, I suspect the thing doesn't even work. Oh well.

> If anyone has anecdotes or opinions, please let me
> know.  Otherwise, I'll submit a patch within the next
> few days.

How about passing a pointer to the associated mii_dev, allowing the
driver to embed the mii_dev into a driver-specific struct and use
container_of() to access the driver-specific data?

This would of course involve changing the declaration of the
miiphy_register() function to take a 'struct mii_dev' instead of all
of the other parameters, but this would in turn allow us to remove
most of the code from that function, and it would allow drivers to
allocate its 'struct mii_dev' statically or as part of a larger

Ok, maybe it's too intrusive and the out-of-tree maintainers will get
angry, but I have to admit that I don't really care that much ;-)


More information about the U-Boot mailing list