diff options
Diffstat (limited to 'net/dsa/dsa.c')
| -rw-r--r-- | net/dsa/dsa.c | 13 | 
1 files changed, 4 insertions, 9 deletions
| diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index a6902c1e2f28..7899919cd9f0 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c @@ -233,6 +233,8 @@ int dsa_cpu_dsa_setup(struct dsa_switch *ds, struct device *dev,  		genphy_read_status(phydev);  		if (ds->ops->adjust_link)  			ds->ops->adjust_link(ds, port, phydev); + +		put_device(&phydev->mdio.dev);  	}  	return 0; @@ -504,15 +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) { -			phy_device_free(phydev); -			fixed_phy_unregister(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) |