OSDN Git Service

net: dsa: mt7530: correct ds->num_ports
authorDENG Qingfang <dqfext@gmail.com>
Sat, 16 Oct 2021 06:24:14 +0000 (14:24 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Oct 2021 12:22:21 +0000 (13:22 +0100)
commit342afce10d6f61c443c95e244f812d4766f73f53
treefe85de461d6a2864a2ad68b7f5130a5a32cfad6a
parent66d262804a2276721eac86cf18fcd61046149193
net: dsa: mt7530: correct ds->num_ports

Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
dsa_port's and call mt7530_port_disable for non-existent ports.

Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
port_enable/disable is no longer required.

Cc: stable@vger.kernel.org
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/mt7530.c