]> asedeno.scripts.mit.edu Git - linux.git/commit
net: axienet: Fix MDIO bus parent node detection
authorRobert Hancock <hancock@sedsystems.ca>
Thu, 6 Jun 2019 22:28:21 +0000 (16:28 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Jun 2019 23:24:30 +0000 (16:24 -0700)
commit3b09a3fb35079106fd490241bdc8e0c31434be00
treea1f91969abac175ab34a16577414a37bebf6f076
parenta4ebb2997c10f3e8b7b2de27c0f2cf3e4123ed09
net: axienet: Fix MDIO bus parent node detection

This driver was previously using the parent node of the specified PHY
node as the device node to register the MDIO bus on. Andrew Lunn
pointed out this is wrong as the PHY node is potentially not even
underneath the MDIO bus for the current device instance. Find the MDIO
node explicitly by looking it up by name under the controller's device
node instead.

This could potentially break existing device trees if they don't use
"mdio" as the name for the MDIO bus, but I did not find any with various
searches and Xilinx's examples all use mdio as the name so it seems like
this should be relatively safe.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c