diff options
author | Michal Vokáč <michal.vokac@ysoft.com> | 2019-10-24 15:46:58 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-10-28 21:39:31 +0100 |
commit | f0d532c43073c8622f63872e3b8f188fec24ab75 (patch) | |
tree | 1d183ab21595d4e82ba80bf57afd93d75e2b9648 | |
parent | net: dsa: fix dereference on ds->dev before null check error (diff) | |
download | linux-f0d532c43073c8622f63872e3b8f188fec24ab75.tar.xz linux-f0d532c43073c8622f63872e3b8f188fec24ab75.zip |
net: dsa: qca8k: Initialize the switch with correct number of ports
Since commit 0394a63acfe2 ("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: 7e99e3470172 ("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>
-rw-r--r-- | drivers/net/dsa/qca8k.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 7e742cd491e8..36c6ed98f8e7 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -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; |