summaryrefslogtreecommitdiff
path: root/net/dsa
diff options
context:
space:
mode:
authorVladimir Oltean <olteanv@gmail.com>2019-06-08 15:04:28 +0300
committerDavid S. Miller <davem@davemloft.net>2019-06-09 01:20:39 +0300
commit5e3f847a02aabfecea519d7b2fd48f4d6f551be6 (patch)
treeb32622186195aa67532df4663bb1f4584a83a616 /net/dsa
parent146d442c2357539589da14d374a25c9a82eb7f1e (diff)
downloadlinux-5e3f847a02aabfecea519d7b2fd48f4d6f551be6.tar.xz
net: dsa: Add teardown callback for drivers
This is helpful for e.g. draining per-driver (not per-port) tagger queues. Signed-off-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 38d11c863b57..3abd173ebacb 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -408,6 +408,9 @@ static void dsa_switch_teardown(struct dsa_switch *ds)
dsa_switch_unregister_notifier(ds);
+ if (ds->ops->teardown)
+ ds->ops->teardown(ds);
+
if (ds->devlink) {
devlink_unregister(ds->devlink);
devlink_free(ds->devlink);