net: dsa: tag_sja1105: do not open-code dsa_switch_for_each_port
authorVladimir Oltean <vladimir.oltean@nxp.com>
Wed, 20 Oct 2021 17:49:54 +0000 (20:49 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Oct 2021 11:44:07 +0000 (12:44 +0100)
Find the remaining iterators over dst->ports that only filter for the
ports belonging to a certain switch, and replace those with the
dsa_switch_for_each_port helper that we have now.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/tag_sja1105.c

index 2edede9..8b2d458 100644 (file)
@@ -158,10 +158,7 @@ static u16 sja1105_xmit_tpid(struct dsa_port *dp)
         * we're sure about that). It may not be on this port though, so we
         * need to find it.
         */
-       list_for_each_entry(other_dp, &ds->dst->ports, list) {
-               if (other_dp->ds != ds)
-                       continue;
-
+       dsa_switch_for_each_port(other_dp, ds) {
                if (!other_dp->bridge_dev)
                        continue;