]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: sja1105: don't assign the host port using dsa_upstream_port()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Mon, 24 May 2021 13:14:16 +0000 (16:14 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 May 2021 20:59:03 +0000 (13:59 -0700)
commit934fd62e69164338585f143ff52f0bc81282de63
tree35a2949ae11ec76a25f0f939acab9d14440a92c7
parent12f7468ff1e5112d89fd61bffa132cc66c536cc5
net: dsa: sja1105: don't assign the host port using dsa_upstream_port()

If @port is unused, then dsa_upstream_port(ds, port) returns @port,
which means we cannot assume the CPU port can be retrieved this way.

The sja1105 switches support a single CPU port, so just iterate over the
switch ports and stop at the first CPU port we see.

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