net: dsa: rtl8366: Check VLAN ID and not ports
authorLinus Walleij <linus.walleij@linaro.org>
Tue, 1 Oct 2019 14:28:43 +0000 (16:28 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Oct 2019 16:09:23 +0000 (12:09 -0400)
commite8521e53cca584ddf8ec4584d3c550a6c65f88c4
tree8b76303b16a4d25a9dce0dbe9109dec37e3a4809
parent8b6b82ad163b54a23f0e89710fb25461d45109c4
net: dsa: rtl8366: Check VLAN ID and not ports

There has been some confusion between the port number and
the VLAN ID in this driver. What we need to check for
validity is the VLAN ID, nothing else.

The current confusion came from assigning a few default
VLANs for default routing and we need to rewrite that
properly.

Instead of checking if the port number is a valid VLAN
ID, check the actual VLAN IDs passed in to the callback
one by one as expected.

Fixes: d8652956cf37 ("net: dsa: realtek-smi: Add Realtek SMI driver")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/rtl8366.c