]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: axienet: allow setups without MDIO
authorDaniel Mack <daniel@zonque.org>
Wed, 24 Mar 2021 13:05:36 +0000 (14:05 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:13:19 +0000 (13:13 +0200)
commit10c717b978a992fd925bb58e210af46bdeade3e2
treeba83ff39387849717e62f4a35d2338c4f72b6fad
parentf4d949ed4958ddf0a3622bad0fde548ec62381ca
net: axienet: allow setups without MDIO

[ Upstream commit de9c7854e6e1589f639c6352112956d08243b659 ]

In setups with fixed-link settings there is no mdio node in DTS.
axienet_probe() already handles that gracefully but lp->mii_bus is
then NULL.

Fix code that tries to blindly grab the MDIO lock by introducing two helper
functions that make the locking conditional.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c