diff options
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r-- | net/dsa/dsa.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c index d8fb47fcad05..1018e7dcfcc9 100644 --- a/net/dsa/dsa.c +++ b/net/dsa/dsa.c | |||
@@ -430,7 +430,18 @@ static void dsa_switch_destroy(struct dsa_switch *ds) | |||
430 | hwmon_device_unregister(ds->hwmon_dev); | 430 | hwmon_device_unregister(ds->hwmon_dev); |
431 | #endif | 431 | #endif |
432 | 432 | ||
433 | /* Disable configuration of the CPU and DSA ports */ | 433 | /* Destroy network devices for physical switch ports. */ |
434 | for (port = 0; port < DSA_MAX_PORTS; port++) { | ||
435 | if (!(ds->phys_port_mask & (1 << port))) | ||
436 | continue; | ||
437 | |||
438 | if (!ds->ports[port]) | ||
439 | continue; | ||
440 | |||
441 | dsa_slave_destroy(ds->ports[port]); | ||
442 | } | ||
443 | |||
444 | /* Remove any fixed link PHYs */ | ||
434 | for (port = 0; port < DSA_MAX_PORTS; port++) { | 445 | for (port = 0; port < DSA_MAX_PORTS; port++) { |
435 | if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) | 446 | if (!(dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port))) |
436 | continue; | 447 | continue; |
@@ -448,17 +459,6 @@ static void dsa_switch_destroy(struct dsa_switch *ds) | |||
448 | } | 459 | } |
449 | } | 460 | } |
450 | 461 | ||
451 | /* Destroy network devices for physical switch ports. */ | ||
452 | for (port = 0; port < DSA_MAX_PORTS; port++) { | ||
453 | if (!(ds->phys_port_mask & (1 << port))) | ||
454 | continue; | ||
455 | |||
456 | if (!ds->ports[port]) | ||
457 | continue; | ||
458 | |||
459 | dsa_slave_destroy(ds->ports[port]); | ||
460 | } | ||
461 | |||
462 | mdiobus_unregister(ds->slave_mii_bus); | 462 | mdiobus_unregister(ds->slave_mii_bus); |
463 | } | 463 | } |
464 | 464 | ||