netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy
@ 2015-10-29 13:23 Neil Armstrong
  2015-10-29 13:44 ` kbuild test robot
  2015-10-29 14:00 ` Andrew Lunn
  0 siblings, 2 replies; 4+ messages in thread
From: Neil Armstrong @ 2015-10-29 13:23 UTC (permalink / raw)
  To: David S. Miller
  Cc: Andrew Lunn, Florian Fainelli, Guenter Roeck, vivien.didelot,
	Fabian Frederick, Pavel Nakonechny, Joe Perches, netdev,
	linux-kernel, Frode Isaksen

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 <fisaksen@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
 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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-10-29 14:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-29 13:23 [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy Neil Armstrong
2015-10-29 13:44 ` kbuild test robot
2015-10-29 14:00 ` Andrew Lunn
2015-10-29 14:06   ` Neil Armstrong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).