From: Mikhail Kshevetskiy Date: Fri, 30 Jan 2026 22:06:25 +0000 (+0300) Subject: net: mdio-mt7531-mmio: fix switch regs initialization X-Git-Tag: v2026.04-rc2~3^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3aabc0dae03b824ffae06a16a48bf2c89b5c36e7;p=thirdparty%2Fu-boot.git 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 --- diff --git a/drivers/net/mdio-mt7531-mmio.c b/drivers/net/mdio-mt7531-mmio.c index 3e325ca58da..5a0725010f2 100644 --- a/drivers/net/mdio-mt7531-mmio.c +++ b/drivers/net/mdio-mt7531-mmio.c @@ -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;