aboutsummaryrefslogtreecommitdiff
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-11-29 23:17:04 -0500
committerDavid S. Miller <davem@davemloft.net>2016-11-29 23:17:04 -0500
commitf2ebf2a6ca94e78be179e8c99d34c87efc5e8bfb (patch)
treed7a3fd6644f2f711212b7e7cc7cabb113747128b /net/dsa/dsa.c
parenta510887824171ad260cc4a2603396c6247fdd091 (diff)
parent881eadabe71fa78c081eda3cd5701768f3778a21 (diff)
Merge branch 'fixed-phy-phydev-leaks'
Johan Hovold says: ==================== net: fix fixed-link phydev leaks This series fixes failures to deregister and free fixed-link phydevs that have been registered using the of_phy_register_fixed_link() interface. All but two drivers currently fail to do this and this series fixes most of them with the exception of a staging driver and the stmmac drivers which will be fixed by follow-on patches. Included are also a couple of fixes for related of-node leaks. Note that all patches except the of_mdio one have been compile-tested only. Also note that the series is against net due to dependencies not yet in net-next. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c12
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)