]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit7e08b7fae34e1adb1a79be4bb772a37ebd110d64
tree10a55d219430fbc6e19977dc546a1349f672d5e3
parentdef4aac71f5aef662ef42d475c41c5bae73323cf
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