From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Thu, 10 Apr 2008 14:30:07 +0000 (+0900)
Subject: macb: Call phy_disconnect on removing
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=84b7901f8d5a17536ef2df7fd628ab865df8fe3a;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git

macb: Call phy_disconnect on removing

Call phy_disconnect() on remove routine.  Otherwise the phy timer
causes a kernel crash when unloading.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
---

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 1d210ed46130..10fcea59755e 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1257,6 +1257,8 @@ static int __exit macb_remove(struct platform_device *pdev)
 
 	if (dev) {
 		bp = netdev_priv(dev);
+		if (bp->phy_dev)
+			phy_disconnect(bp->phy_dev);
 		mdiobus_unregister(&bp->mii_bus);
 		kfree(bp->mii_bus.irq);
 		unregister_netdev(dev);