net: dsa: use ports list to setup default CPU port

Use the new ports list instead of iterating over switches and their
ports when setting up the default CPU port. Unassign it on teardown.

Now that we can iterate over multiple CPU ports, remove dst->cpu_dp.

At the same time, provide a better error message for CPU-less tree.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
This commit is contained in:
Vivien Didelot
2019-10-22 12:37:07 -07:00
committed by Jakub Kicinski
parent c0b736282c
commit da4561cda2
2 changed files with 12 additions and 26 deletions
-5
View File
@@ -120,11 +120,6 @@ struct dsa_switch_tree {
*/
struct dsa_platform_data *pd;
/*
* The switch port to which the CPU is attached.
*/
struct dsa_port *cpu_dp;
/* List of switch ports */
struct list_head ports;