]> Gentwo Git Trees - linux/.git/commit
net: stmmac: mdio: provide stmmac_mdio_wait()
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Thu, 4 Sep 2025 12:11:05 +0000 (13:11 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Sep 2025 01:12:02 +0000 (18:12 -0700)
commit9eb633ad1d69930e7ddc9d86bdc30700e2b794eb
tree163d44b4052ed7d1da82026a6cd5469e6594e67b
parent16e03235d51b016cbb9b2265b77f041b57b1ed54
net: stmmac: mdio: provide stmmac_mdio_wait()

All the readl_poll_timeout()s follow the same pattern - test a register
for a bit being clear every 100us, and timeout after 10ms returning
-EBUSY. Wrap this up into a function to avoid duplicating this.

This slightly changes the return value for stmmac_mdio_write() if the
second readl_poll_timeout() fails - rather than returning -ETIMEDOUT
we return -EBUSY matching the stmmac_mdio_read() behaviour.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Mohd Ayaan Anwar <quic_mohdayaa@quicinc.com>
Link: https://patch.msgid.link/E1uu8nx-00000001voa-0tJ0@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c