Subject: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy

From: Neil Armstrong <[email-masked]>
Date: Thu, 29 Oct 2015 14:23:25 +0100

Add missing netif_carrier_off and phy_disconnect calls to the
dsa_switch_destroy function to make sure the netdev and phy
ressources are clean before complete removal.

Signed-off-by: Frode Isaksen <[email-masked]>
Signed-off-by: Neil Armstrong <[email-masked]>
---
 net/dsa/dsa.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 597a462..11452e4 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -454,7 +454,9 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
 		if (!ds->ports[port])
 			continue;

+		netif_carrier_off(ds->ports[port]);
 		unregister_netdev(ds->ports[port]);
+		phy_disconnect(p->phy);
 		free_netdev(ds->ports[port]);
 	}

-- 
1.9.1