Commit fd944dc2 authored by Matthias Schiffer's avatar Matthias Schiffer Committed by David S. Miller

net: dsa: microchip: ksz8795: really set the correct number of ports

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: af199a1a ("net: dsa: microchip: set the correct number of ports")
Signed-off-by: default avatarMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: default avatarCodrin Ciubotariu <codrin.ciubotariu@microchip.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 34beb215
...@@ -1260,7 +1260,7 @@ static int ksz8795_switch_init(struct ksz_device *dev) ...@@ -1260,7 +1260,7 @@ static int ksz8795_switch_init(struct ksz_device *dev)
} }
/* set the real number of ports */ /* set the real number of ports */
dev->ds->num_ports = dev->port_cnt; dev->ds->num_ports = dev->port_cnt + 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment