Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1258782

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

From Neil Armstrong <narmstrong@baylibre.com>
Newsgroups linux.kernel
Subject [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy
Date 2015-10-29 14:30 +0100
Message-ID <qoVrc-Hx-7@gated-at.bofh.it> (permalink)
Organization Baylibre

Show all headers | View raw


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy Neil Armstrong <narmstrong@baylibre.com> - 2015-10-29 14:30 +0100
  Re: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy Andrew Lunn <andrew@lunn.ch> - 2015-10-29 15:10 +0100
    Re: [PATCH v2 5/6] net: dsa: add missing calls in dsa_switch_destroy Neil Armstrong <narmstrong@baylibre.com> - 2015-10-29 15:10 +0100

csiph-web