Skip to content

Commit

Permalink
net: dsa: qca8k: correctly handle mdio read error
Browse files Browse the repository at this point in the history
[ Upstream commit 6cfc03b ]

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: ce062a0 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Ansuel authored and gregkh committed Jun 9, 2022
1 parent 07230a1 commit 504999e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/dsa/qca8k.c
Expand Up @@ -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
Expand Down

0 comments on commit 504999e

Please sign in to comment.