mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 06:32:08 +00:00
net: dsa: Add a ports structure and use it in the switch structure
There are going to be more per-port members added to the switch structure. So add a port structure and move the netdev into it. Signed-off-by: Andrew Lunn <andrew@lunn.ch> Reviewed-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
149cafd790
commit
c8b098086b
9 changed files with 38 additions and 29 deletions
|
@ -437,10 +437,10 @@ static void dsa_switch_destroy(struct dsa_switch *ds)
|
|||
if (!(ds->enabled_port_mask & (1 << port)))
|
||||
continue;
|
||||
|
||||
if (!ds->ports[port])
|
||||
if (!ds->ports[port].netdev)
|
||||
continue;
|
||||
|
||||
dsa_slave_destroy(ds->ports[port]);
|
||||
dsa_slave_destroy(ds->ports[port].netdev);
|
||||
}
|
||||
|
||||
/* Remove any fixed link PHYs */
|
||||
|
@ -469,7 +469,7 @@ static int dsa_switch_suspend(struct dsa_switch *ds)
|
|||
if (!dsa_is_port_initialized(ds, i))
|
||||
continue;
|
||||
|
||||
ret = dsa_slave_suspend(ds->ports[i]);
|
||||
ret = dsa_slave_suspend(ds->ports[i].netdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
@ -495,7 +495,7 @@ static int dsa_switch_resume(struct dsa_switch *ds)
|
|||
if (!dsa_is_port_initialized(ds, i))
|
||||
continue;
|
||||
|
||||
ret = dsa_slave_resume(ds->ports[i]);
|
||||
ret = dsa_slave_resume(ds->ports[i].netdev);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue