提交 f0d532c4 编写于 作者: M Michal Vokáč 提交者: David S. Miller

net: dsa: qca8k: Initialize the switch with correct number of ports

Since commit 0394a63a ("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: 7e99e347 ("net: dsa: remove dsa_switch_alloc helper")
Signed-off-by: NMichal Vokáč <michal.vokac@ysoft.com>
Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 556f124f
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册