Skip to content

Commit

Permalink
net: dsa: qca8k: Initialize the switch with correct number of ports
Browse files Browse the repository at this point in the history
Since commit 0394a63 ("net: dsa: enable and disable all ports")
the dsa core disables all unused ports of a switch. In this case
disabling ports with numbers higher than QCA8K_NUM_PORTS causes that
some switch registers are overwritten with incorrect content.

To fix this, initialize the dsa_switch->num_ports with correct number
of ports.

Fixes: 7e99e34 ("net: dsa: remove dsa_switch_alloc helper")
Signed-off-by: Michal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Michal Vokáč authored and David S. Miller committed Oct 28, 2019
1 parent 556f124 commit f0d532c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/dsa/qca8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev)
return -ENOMEM;

priv->ds->dev = &mdiodev->dev;
priv->ds->num_ports = DSA_MAX_PORTS;
priv->ds->num_ports = QCA8K_NUM_PORTS;
priv->ds->priv = priv;
priv->ops = qca8k_switch_ops;
priv->ds->ops = &priv->ops;
Expand Down

0 comments on commit f0d532c

Please sign in to comment.