diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2026-01-31 01:06:25 +0300 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2026-02-06 16:42:45 +0100 |
| commit | 3aabc0dae03b824ffae06a16a48bf2c89b5c36e7 (patch) | |
| tree | a6d72c4f3de042db2693eeda0a2c57dc95d2e775 | |
| parent | caa62920e32a4ea2c134b44265eb19429814b430 (diff) | |
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 <[email protected]>
| -rw-r--r-- | drivers/net/mdio-mt7531-mmio.c | 7 |
1 files changed, 6 insertions, 1 deletions
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; |
