lkml.org 
[lkml]   [2019]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 net-next 02/10] net: dsa: Add teardown callback for drivers
Date
This is helpful for e.g. draining per-driver (not per-port) tagger
queues.

Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
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 a7f36219904f..4033e0677be4 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -361,6 +361,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 b70befe8a3c8..5bd3e9a4c709 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -407,6 +407,9 @@ static int dsa_switch_setup(struct dsa_switch *ds)

static void dsa_switch_teardown(struct dsa_switch *ds)
{
+ if (ds->ops->teardown)
+ ds->ops->teardown(ds);
+
if (ds->slave_mii_bus && ds->ops->phy_read)
mdiobus_unregister(ds->slave_mii_bus);

--
2.17.1
\
 
 \ /
  Last update: 2019-06-02 23:41    [W:0.101 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site