mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
net: of_mdio: add of_mdiobus_link_phydev()
Add a function to walk the list of subnodes of a mdio bus and look for a node that matches the phy's address with its 'reg' property. If found, set the of_node pointer for the phy. This allows auto-probed pyh devices to be augmented by information passed in via DT. Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8f8382888c
commit
86f6cf4127
3 changed files with 47 additions and 0 deletions
|
@ -25,6 +25,9 @@ struct phy_device *of_phy_attach(struct net_device *dev,
|
|||
|
||||
extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np);
|
||||
|
||||
extern void of_mdiobus_link_phydev(struct mii_bus *mdio,
|
||||
struct phy_device *phydev);
|
||||
|
||||
#else /* CONFIG_OF */
|
||||
static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np)
|
||||
{
|
||||
|
@ -60,6 +63,11 @@ static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np)
|
|||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void of_mdiobus_link_phydev(struct mii_bus *mdio,
|
||||
struct phy_device *phydev)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_OF */
|
||||
|
||||
#if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue