• Jeremy Linton's avatar
    mdio_bus: Add generic mdio_find_bus() · ce69e216
    Jeremy Linton authored
    It appears most ethernet drivers follow one of two main strategies
    for mdio bus/phy management. A monolithic model where the net driver
    itself creates, probes and uses the phy, and one where an external
    mdio/phy driver instantiates the mdio bus/phy and the net driver
    only attaches to a known phy. Usually in this latter model the phys
    are discovered via DT relationships or simply phy name/address
    hardcoding.
    
    This is a shame because modern well behaved mdio buses are self
    describing and can be probed. The mdio layer itself is fully capable
    of this, yet there isn't a clean way for a standalone net driver
    to attach and enumerate the discovered devices. This is because
    outside of of_mdio_find_bus() there isn't a straightforward way
    to acquire the mii_bus pointer.
    
    So, lets add a mdio_find_bus which can return the mii_bus based
    only on its name.
    Signed-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
    Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ce69e216
mdio_bus.c 25.9 KB