Skip to content

Commit fd944dc

Browse files
tq-schiffermdavem330
authored andcommitted
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: af199a1 ("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>
1 parent 34beb21 commit fd944dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/dsa/microchip/ksz8795.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ static int ksz8795_switch_init(struct ksz_device *dev)
12601260
}
12611261

12621262
/* set the real number of ports */
1263-
dev->ds->num_ports = dev->port_cnt;
1263+
dev->ds->num_ports = dev->port_cnt + 1;
12641264

12651265
return 0;
12661266
}

0 commit comments

Comments
 (0)