Skip to contentSkip to conversation

ibm/emac: fix improper cleanup when device is removed to allow re-bind

PATCH Applied Wolfgang Grandegger 2 participants 2 messages Nov 17, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ibm/emac: fix improper cleanup when device is removed to allow re-bind

The re-binding (unbind..bind) of an EMAC device fails because the static variable "busy_phy_map" is not updated when the device is removed.

---
 drivers/net/ethernet/ibm/emac/core.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
drivers/net/ethernet/ibm/emac/core.c +3 -0
index ed79b2d..2abce96 100644
@@ -2924,6 +2924,9 @@ static int __devexit emac_remove(struct platform_device *ofdev)
 	if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII))
 		zmii_detach(dev->zmii_dev, dev->zmii_port);
 
+	busy_phy_map &= ~(1 << dev->phy.address);
+	DBG(dev, "busy_phy_map now %#x" NL, busy_phy_map);
+
 	mal_unregister_commac(dev->mal, &dev->commac);
 	emac_put_deps(dev);
 
Signature · 1 line
1.7.4.1