net: axienet: allow setups without MDIO
authorDaniel Mack <daniel@zonque.org>
Wed, 24 Mar 2021 13:05:36 +0000 (14:05 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 25 Mar 2021 23:49:40 +0000 (16:49 -0700)
commitde9c7854e6e1589f639c6352112956d08243b659
tree10a55d219430fbc6e19977dc546a1349f672d5e3
parent479dc497db8322ae486f8ee49020f5600a77a680
net: axienet: allow setups without MDIO

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>
drivers/net/ethernet/xilinx/xilinx_axienet.h
drivers/net/ethernet/xilinx/xilinx_axienet_main.c