Skip to content

Commit

Permalink
net: dsa: Add teardown callback for drivers
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Oltean authored and David S. Miller committed Jun 8, 2019
1 parent 146d442 commit 5e3f847
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/net/dsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down
3 changes: 3 additions & 0 deletions net/dsa/dsa2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5e3f847

Please sign in to comment.