mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
net: mdio-mt7531-mmio: fix switch regs initialization
mdio is a child node of the switch, so to get switch base address we need to lookup for a parent node Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
This commit is contained in:
committed by
Jerome Forissier
parent
caa62920e3
commit
3aabc0dae0
@@ -151,8 +151,13 @@ static const struct mdio_ops mt7531_mdio_ops = {
|
||||
static int mt7531_mdio_probe(struct udevice *dev)
|
||||
{
|
||||
struct mt7531_mdio_priv *priv = dev_get_priv(dev);
|
||||
ofnode switch_node;
|
||||
|
||||
priv->switch_regs = dev_read_addr(dev);
|
||||
switch_node = ofnode_get_parent(dev_ofnode(dev));
|
||||
if (!ofnode_valid(switch_node))
|
||||
return -EINVAL;
|
||||
|
||||
priv->switch_regs = ofnode_get_addr(switch_node);
|
||||
if (priv->switch_regs == FDT_ADDR_T_NONE)
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user