aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorRichard Cochran <richardcochran@gmail.com>2019-12-25 18:16:18 -0800
committerDavid S. Miller <davem@davemloft.net>2019-12-25 19:51:33 -0800
commit1dca22b1842136f57e9bd60fefd1715c22ff1874 (patch)
tree5e8f379e9899a8f1c4fe46414bf8ebff8695faf8 /drivers/net/phy/phy_device.c
parentdt-bindings: ptp: Introduce MII time stamping devices. (diff)
downloadlinux-dev-1dca22b1842136f57e9bd60fefd1715c22ff1874.tar.xz
linux-dev-1dca22b1842136f57e9bd60fefd1715c22ff1874.zip
net: mdio: of: Register discovered MII time stampers.
When parsing a PHY node, register its time stamper, if any, and attach the instance to the PHY device. Signed-off-by: Richard Cochran <richardcochran@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r--drivers/net/phy/phy_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index e55119cd6c86..e5dc9f87f495 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -881,6 +881,9 @@ EXPORT_SYMBOL(phy_device_register);
*/
void phy_device_remove(struct phy_device *phydev)
{
+ if (phydev->mii_ts)
+ unregister_mii_timestamper(phydev->mii_ts);
+
device_del(&phydev->mdio.dev);
/* Assert the reset signal */