obj-$(CONFIG_SWCONFIG) += swconfig.o
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
-@@ -1003,6 +1003,7 @@ void phy_detach(struct phy_device *phyde
+@@ -1021,6 +1021,7 @@ void phy_detach(struct phy_device *phyde
phydev->attached_dev->phydev = NULL;
phydev->attached_dev = NULL;
phy_suspend(phydev);
+ phydev->phylink = NULL;
- /* If the device had no specific driver before (i.e. - it
- * was using the generic driver), we unbind the device
+ module_put(phydev->mdio.dev.driver->owner);
+
--- /dev/null
+++ b/drivers/net/phy/phylink.c
@@ -0,0 +1,903 @@