[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190608120443.21889-3-olteanv@gmail.com>
Date: Sat, 8 Jun 2019 15:04:28 +0300
From: Vladimir Oltean <olteanv@...il.com>
To: f.fainelli@...il.com, vivien.didelot@...il.com, andrew@...n.ch,
davem@...emloft.net, richardcochran@...il.com,
john.stultz@...aro.org, tglx@...utronix.de, sboyd@...nel.org
Cc: linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Vladimir Oltean <olteanv@...il.com>
Subject: [PATCH v4 net-next 02/17] 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@...il.com>
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
---
Changes in v4:
None.
Changes in v3:
Moved after dsa_switch_unregister_notifier, which is symmetrical to
where the setup callback is.
Changes in v2:
Patch is new.
include/net/dsa.h | 1 +
net/dsa/dsa2.c | 3 +++
2 files changed, 4 insertions(+)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 1131d9fac20b..82a2baa2dc48 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -357,6 +357,7 @@ struct dsa_switch_ops {
int port);
int (*setup)(struct dsa_switch *ds);
+ void (*teardown)(struct dsa_switch *ds);
u32 (*get_phy_flags)(struct dsa_switch *ds, int port);
/*
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);
--
2.17.1
Powered by blists - more mailing lists