mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 07:12:09 +00:00
net: dsa: use dsa_is_user_port everywhere
Most of the DSA code still check ds->enabled_port_mask directly to inspect a given port type instead of using the provided dsa_is_user_port helper. Change this. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
2b3e9891cb
commit
4a5b85ffe2
6 changed files with 12 additions and 13 deletions
|
@ -201,7 +201,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
|
|||
#ifdef CONFIG_PM_SLEEP
|
||||
static bool dsa_is_port_initialized(struct dsa_switch *ds, int p)
|
||||
{
|
||||
return ds->enabled_port_mask & (1 << p) && ds->ports[p].slave;
|
||||
return dsa_is_user_port(ds, p) && ds->ports[p].slave;
|
||||
}
|
||||
|
||||
int dsa_switch_suspend(struct dsa_switch *ds)
|
||||
|
|
|
@ -190,7 +190,7 @@ static int dsa_switch_setup_one(struct dsa_switch *ds,
|
|||
ds->ports[i].dn = cd->port_dn[i];
|
||||
ds->ports[i].cpu_dp = dst->cpu_dp;
|
||||
|
||||
if (!(ds->enabled_port_mask & (1 << i)))
|
||||
if (dsa_is_user_port(ds, i))
|
||||
continue;
|
||||
|
||||
ret = dsa_slave_create(&ds->ports[i], cd->port_names[i]);
|
||||
|
@ -258,7 +258,7 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
|
|||
|
||||
/* Destroy network devices for physical switch ports. */
|
||||
for (port = 0; port < ds->num_ports; port++) {
|
||||
if (!(ds->enabled_port_mask & (1 << port)))
|
||||
if (!dsa_is_user_port(ds, port))
|
||||
continue;
|
||||
|
||||
if (!ds->ports[port].slave)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue