net: dsa: qca8k: fix kernel panic with legacy mdio mapping
authorAnsuel Smith <ansuelsmth@gmail.com>
Sat, 11 Sep 2021 15:50:09 +0000 (17:50 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 12 Sep 2021 09:47:31 +0000 (10:47 +0100)
commitce062a0adbfe933b1932235fdfd874c4c91d1bb0
tree53da0870879d3b14fa9ca03c45f5069dea1b4cbd
parent08dad2f4d541fcfe5e7bfda72cc6314bbfd2802f
net: dsa: qca8k: fix kernel panic with legacy mdio mapping

When the mdio legacy mapping is used the mii_bus priv registered by DSA
refer to the dsa switch struct instead of the qca8k_priv struct and
causes a kernel panic. Create dedicated function when the internal
dedicated mdio driver is used to properly handle the 2 different
implementation.

Fixes: 759bafb8a322 ("net: dsa: qca8k: add support for internal phy and internal mdio")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c