You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
phy: Add API for {un}registering an mdio device to a bus.
Rather than have drivers directly manipulate the mii_bus structure, provide and API for registering and unregistering devices on an MDIO bus, and performing lookups. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
801a8ef54e
commit
7f854420fb
@@ -678,7 +678,7 @@ static int ethoc_mdio_probe(struct net_device *dev)
|
||||
int err;
|
||||
|
||||
if (priv->phy_id != -1)
|
||||
phy = priv->mdio->phy_map[priv->phy_id];
|
||||
phy = mdiobus_get_phy(priv->mdio, priv->phy_id);
|
||||
else
|
||||
phy = phy_find_first(priv->mdio);
|
||||
|
||||
@@ -766,7 +766,7 @@ static int ethoc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
if (mdio->phy_id >= PHY_MAX_ADDR)
|
||||
return -ERANGE;
|
||||
|
||||
phy = priv->mdio->phy_map[mdio->phy_id];
|
||||
phy = mdiobus_get_phy(priv->mdio, mdio->phy_id);
|
||||
if (!phy)
|
||||
return -ENODEV;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user