phy: Add an mdio_device structure

Not all devices attached to an MDIO bus are phys. So add an
mdio_device structure to represent the generic parts of an mdio
device, and place this structure into the phy_device.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Andrew Lunn
2016-01-06 20:11:16 +01:00
committed by David S. Miller
parent e7f4dc3536
commit e5a03bfd87
35 changed files with 165 additions and 151 deletions

View File

@@ -75,7 +75,7 @@ static int of_mdiobus_register_phy(struct mii_bus *mdio, struct device_node *chi
/* Associate the OF node with the device structure so it
* can be looked up later */
of_node_get(child);
phy->dev.of_node = child;
phy->mdio.dev.of_node = child;
/* All data is now stored in the phy struct;
* register it */
@@ -233,7 +233,7 @@ struct phy_device *of_phy_connect(struct net_device *dev,
ret = phy_connect_direct(dev, phy, hndlr, iface);
/* refcount is held by phy_connect_direct() on success */
put_device(&phy->dev);
put_device(&phy->mdio.dev);
return ret ? NULL : phy;
}
@@ -263,7 +263,7 @@ struct phy_device *of_phy_attach(struct net_device *dev,
ret = phy_attach_direct(dev, phy, flags, iface);
/* refcount is held by phy_attach_direct() on success */
put_device(&phy->dev);
put_device(&phy->mdio.dev);
return ret ? NULL : phy;
}