mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-31 22:34:33 +01:00
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 <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
146d442c23
commit
5e3f847a02
2 files changed
+4
No files matched your search
@@ -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);
|
||||
|
||||
/*
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user