mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
net: dsa: Initialize all CPU and enabled ports masks in dsa_ds_parse()
There was no reason for duplicating the code that initializes ds->enabled_port_mask in both dsa_parse_ports_dn() and dsa_parse_ports(), instead move this to dsa_ds_parse() which is early enough before ops->setup() has run. While at it, we can now make dsa_is_cpu_port() check ds->cpu_port_mask which is a step towards being multi-CPU port capable. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e41c1b5030
commit
14be36c2c9
2 changed files with 16 additions and 19 deletions
|
@ -254,7 +254,7 @@ struct dsa_switch {
|
|||
|
||||
static inline bool dsa_is_cpu_port(struct dsa_switch *ds, int p)
|
||||
{
|
||||
return ds->dst->cpu_dp == &ds->ports[p];
|
||||
return !!(ds->cpu_port_mask & (1 << p));
|
||||
}
|
||||
|
||||
static inline bool dsa_is_dsa_port(struct dsa_switch *ds, int p)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue