Skip to content

Commit d19741b

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: felix: perform teardown in reverse order of setup
In general it is desirable that cleanup is the reverse process of setup. In this case I am not seeing any particular issue, but with the introduction of devlink-sb for felix, a non-obvious decision had to be made as to where to put its cleanup method. When there's a convention in place, that decision becomes obvious. Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent a709691 commit d19741b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/net/dsa/ocelot/felix.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -609,14 +609,14 @@ static void felix_teardown(struct dsa_switch *ds)
609609
struct felix *felix = ocelot_to_felix(ocelot);
610610
int port;
611611

612-
if (felix->info->mdio_bus_free)
613-
felix->info->mdio_bus_free(ocelot);
612+
ocelot_deinit_timestamp(ocelot);
613+
ocelot_deinit(ocelot);
614614

615615
for (port = 0; port < ocelot->num_phys_ports; port++)
616616
ocelot_deinit_port(ocelot, port);
617-
ocelot_deinit_timestamp(ocelot);
618-
/* stop workqueue thread */
619-
ocelot_deinit(ocelot);
617+
618+
if (felix->info->mdio_bus_free)
619+
felix->info->mdio_bus_free(ocelot);
620620
}
621621

622622
static int felix_hwtstamp_get(struct dsa_switch *ds, int port,

0 commit comments

Comments
 (0)