• Vladimir Oltean's avatar
    net: dsa: sja1105: rely on DSA core tracking of port learning state · 5313a37b
    Vladimir Oltean authored
    Now that DSA keeps track of the port learning state, it becomes
    superfluous to keep an additional variable with this information in the
    sja1105 driver. Remove it.
    
    The DSA core's learning state is present in struct dsa_port *dp.
    To avoid the antipattern where we iterate through a DSA switch's
    ports and then call dsa_to_port to obtain the "dp" reference (which is
    bad because dsa_to_port iterates through the DSA switch tree once
    again), just iterate through the dst->ports and operate on those
    directly.
    
    The sja1105 had an extra use of priv->learn_ena on non-user ports. DSA
    does not touch the learning state of those ports - drivers are free to
    do what they wish on them. Mark that information with a comment in
    struct dsa_port and let sja1105 set dp->learning for cascade ports.
    Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    5313a37b
sja1105.h 11.7 KB