diff options
author | Johan Hovold <johan@kernel.org> | 2016-11-28 19:24:55 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-29 23:17:02 -0500 |
commit | 3f65047c853a2a5abcd8ac1984af3452b5df4ada (patch) | |
tree | 922554935869406027239cc62a6a904b339c6373 /net | |
parent | 0d8f3c67151faaa80e332c254372dca58fb2a9d4 (diff) | |
download | talos-obmc-linux-3f65047c853a2a5abcd8ac1984af3452b5df4ada.tar.gz talos-obmc-linux-3f65047c853a2a5abcd8ac1984af3452b5df4ada.zip |
of_mdio: add helper to deregister fixed-link PHYs
Add helper to deregister fixed-link PHYs registered using
of_phy_register_fixed_link().
Convert the two drivers that care to deregister their fixed-link PHYs to
use the new helper, but note that most drivers currently fail to do so.
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/dsa.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index cb0091b99592..7899919cd9f0 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -506,16 +506,8 @@ dsa_switch_setup(struct dsa_switch_tree *dst, int index, void dsa_cpu_dsa_destroy(struct device_node *port_dn) { - struct phy_device *phydev; - - if (of_phy_is_fixed_link(port_dn)) { - phydev = of_phy_find_device(port_dn); - if (phydev) { - fixed_phy_unregister(phydev); - put_device(&phydev->mdio.dev); - phy_device_free(phydev); - } - } + if (of_phy_is_fixed_link(port_dn)) + of_phy_deregister_fixed_link(port_dn); } static void dsa_switch_destroy(struct dsa_switch *ds) |