net: mii_timestamper: fix static allocation by PHY driver
authorMichael Walle <michael@walle.cc>
Thu, 30 Jan 2020 17:44:51 +0000 (18:44 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 31 Jan 2020 15:46:11 +0000 (07:46 -0800)
commit2e1bf3a76576eebc787d8882c3f91fa4ec743efc
tree25853cebe19b720cfca998dcf2cd5d5a09270e16
parent0e0daf6ac3be70608569262246f6dc33cb3f45fe
net: mii_timestamper: fix static allocation by PHY driver

If phydev->mii_ts is set by the PHY driver, it will always be
overwritten in of_mdiobus_register_phy(). Fix it. Also make sure, that
the unregister() doesn't do anything if the mii_timestamper was provided by
the PHY driver.

Fixes: 1dca22b18421 ("net: mdio: of: Register discovered MII time stampers.")
Signed-off-by: Michael Walle <michael@walle.cc>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/mii_timestamper.c
drivers/of/of_mdio.c