From: Haavard Skinnemoen Date: Sat, 20 Jan 2007 13:34:47 +0100 Subject: [U-Boot-Users] RFC: miiphy changes In-Reply-To: <193867.85671.qm@web302.biz.mail.mud.yahoo.com> References: <193867.85671.qm@web302.biz.mail.mud.yahoo.com> Message-ID: <1defaf580701200434m2609dca1m2b541eaf6471ba5b@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 1/20/07, Ben Warren 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 allocation. 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 ;-) Haavard