net: dsa: b53: Fix default VLAN ID
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 15 Feb 2019 20:16:49 +0000 (12:16 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 27 Jan 2020 13:50:23 +0000 (14:50 +0100)
commit8234d30d8e95d673f5e5117768299902e48b8138
tree2afef653c87f15f0e06fd37a6d346630547f1ff4
parent0abc0d523aa25d4e993c266374e7a807d5897461
net: dsa: b53: Fix default VLAN ID

[ Upstream commit fea83353177a55540c71c140887737c282137aa2 ]

We were not consistent in how the default VID of a given port was
defined, b53_br_leave() would make sure the VLAN ID would be either 0/1
depending on the switch generation, but b53_configure_vlan(), which is
the default configuration would unconditionally set it to 1. The correct
value is 1 for 5325/5365 series and 0 otherwise. To avoid repeating that
mistake ever again, introduce a helper function: b53_default_pvid() to
factor that out.

Fixes: 967dd82ffc52 ("net: dsa: b53: Add support for Broadcom RoboSwitch")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/dsa/b53/b53_common.c