Skip to content

Commit

Permalink
net: dsa: microchip: ksz8795: align port_cnt usage with other microch…
Browse files Browse the repository at this point in the history
…ip drivers

The ksz8795 driver is using port_cnt differently to the other microchip
DSA drivers. It sets it to the external physical port count, than the
whole port count (including the cpu port). This patch is aligning the
variables purpose with the other microchip drivers.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Michael Grzeschik authored and Jakub Kicinski committed Dec 3, 2020
1 parent 557d1a1 commit 94374dd
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/net/dsa/microchip/ksz8795.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = {
.num_alus = 0,
.num_statics = 8,
.cpu_ports = 0x10, /* can be configured as cpu port */
.port_cnt = 4, /* total physical port count */
.port_cnt = 5, /* total cpu and user ports */
},
{
.chip_id = 0x8794,
Expand All @@ -1193,7 +1193,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = {
.num_alus = 0,
.num_statics = 8,
.cpu_ports = 0x10, /* can be configured as cpu port */
.port_cnt = 3, /* total physical port count */
.port_cnt = 4, /* total cpu and user ports */
},
{
.chip_id = 0x8765,
Expand All @@ -1202,7 +1202,7 @@ static const struct ksz_chip_data ksz8795_switch_chips[] = {
.num_alus = 0,
.num_statics = 8,
.cpu_ports = 0x10, /* can be configured as cpu port */
.port_cnt = 4, /* total physical port count */
.port_cnt = 5, /* total cpu and user ports */
},
};

Expand Down Expand Up @@ -1238,7 +1238,7 @@ static int ksz8795_switch_init(struct ksz_device *dev)
dev->mib_cnt = ARRAY_SIZE(mib_names);

dev->mib_port_cnt = TOTAL_PORT_NUM;
dev->phy_port_cnt = dev->port_cnt;
dev->phy_port_cnt = dev->port_cnt - 1;

dev->cpu_port = dev->mib_port_cnt - 1;
dev->host_mask = BIT(dev->cpu_port);
Expand All @@ -1260,7 +1260,7 @@ static int ksz8795_switch_init(struct ksz_device *dev)
}

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

return 0;
}
Expand Down

0 comments on commit 94374dd

Please sign in to comment.