[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fa686aa40903182135v51bbeafahc7fa899fb454a312@mail.gmail.com>
Date: Wed, 18 Mar 2009 22:35:14 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: avorontsov@...mvista.com
Cc: afleming@...escale.com, linuxppc-dev@...abs.org,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
jgarzik@...ox.com
Subject: Re: [PATCH 5/5] net: make mpc5200 fec driver use of_mdio
infrastructure
On Tue, Mar 10, 2009 at 2:29 PM, Anton Vorontsov
<avorontsov@...mvista.com> wrote:
> On Tue, Mar 10, 2009 at 01:48:26PM -0600, Grant Likely wrote:
>> Regardless, I
>> think all the drivers should be using common code for obtaining the
>> phy_device from the device tree.
>
> Not necessary `struct phy_device'. All we need is some common
> routine for translating PHY's "mdio_node->full_name + phy id" to
> phy_bus_id.
This only works if the network driver knows how the MDIO bus is named.
The current code assumes that the MDIO bus name is the register
address, but this is a driver implementation detail and MDIO bus
drivers can deviate from this. What about MDIO busses that don't have
a reg property? For example, fs_enet/mii-bitbang.c sets the bus name
to "CPM2 Bitbanged MII". There is no one-size-fits-all way to figure
out the phy bus id from the ethernet driver side of things.
The sure and simple way to guarantee a match between the PHY device
node and the phy_device is to use the PHY device_node pointer itself
as the search key.
I concede that my first attempt at this was overly complex, but I've
reworked the code and I think it makes thinks considerably simpler.
I'll post a new series tomorrow. I've got patches to make the
ucc_eth, gianfar and fs_enet drivers to use the device_node method
also.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists