diff options
author | Ansuel Smith <ansuelsmth@gmail.com> | 2022-04-16 01:30:16 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-04-17 14:28:29 +0200 |
commit | 6cfc03b602200c5cbbd8d906fd905547814e83df (patch) | |
tree | 8a45fac12abf4e4a890a36173bb7f874e3bc9493 /drivers/net/dsa/qca8k.c | |
parent | net: dsa: qca8k: drop dsa_switch_ops from qca8k_priv (diff) | |
download | linux-6cfc03b602200c5cbbd8d906fd905547814e83df.tar.xz linux-6cfc03b602200c5cbbd8d906fd905547814e83df.zip |
net: dsa: qca8k: correctly handle mdio read error
Restore original way to handle mdio read error by returning 0xffff.
This was wrongly changed when the internal_mdio_read was introduced,
now that both legacy and internal use the same function, make sure that
they behave the same way.
Fixes: ce062a0adbfe ("net: dsa: qca8k: fix kernel panic with legacy mdio mapping")
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/dsa/qca8k.c')
-rw-r--r-- | drivers/net/dsa/qca8k.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index ef8d686de609..4fb1486795c4 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -1287,7 +1287,12 @@ qca8k_internal_mdio_read(struct mii_bus *slave_bus, int phy, int regnum) if (ret >= 0) return ret; - return qca8k_mdio_read(priv, phy, regnum); + ret = qca8k_mdio_read(priv, phy, regnum); + + if (ret < 0) + return 0xffff; + + return ret; } static int |