net: dsa: microchip: ksz8795: really set the correct number of ports
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 16 Sep 2020 10:08:39 +0000 (12:08 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 26 Sep 2020 16:05:28 +0000 (18:05 +0200)
commitd8c79a8b0671513619725af3b9bd5a206f97158c
treeb219c080f3a2d5294fc79ac0f7d4a727611adf6a
parent86ae8bdee923846f9fb3bbdaad1e7aa4704d5be2
net: dsa: microchip: ksz8795: really set the correct number of ports

[ Upstream commit fd944dc24336922656a48f4608bfb41abdcdc4aa ]

The KSZ9477 and KSZ8795 use the port_cnt field differently: For the
KSZ9477, it includes the CPU port(s), while for the KSZ8795, it doesn't.

It would be a good cleanup to make the handling of both drivers match,
but as a first step, fix the recently broken assignment of num_ports in
the KSZ8795 driver (which completely broke probing, as the CPU port
index was always failing the num_ports check).

Fixes: af199a1a9cb0 ("net: dsa: microchip: set the correct number of ports")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/dsa/microchip/ksz8795.c