Message ID | 20240123215606.26716-8-luizluca@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: realtek: variants to drivers, interfaces to a common module | expand |
On 1/23/2024 1:55 PM, Luiz Angelo Daros de Luca wrote: > The binding docs requires for SMI-connected devices that the switch > must have a child node named "mdio" and with a compatible string of > "realtek,smi-mdio". Meanwile, for MDIO-connected switches, the binding > docs only requires a child node named "mdio". > > This patch changes the driver to use the common denominator for both > interfaces, looking for the MDIO node by name, ignoring the compatible > string. > > Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> > Reviewed-by: Vladimir Oltean <olteanv@gmail.com> Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
diff --git a/drivers/net/dsa/realtek/realtek-smi.c b/drivers/net/dsa/realtek/realtek-smi.c index 5533b79d67f5..0ccb2a6059a6 100644 --- a/drivers/net/dsa/realtek/realtek-smi.c +++ b/drivers/net/dsa/realtek/realtek-smi.c @@ -333,7 +333,7 @@ static int realtek_smi_setup_mdio(struct dsa_switch *ds) struct device_node *mdio_np; int ret; - mdio_np = of_get_compatible_child(priv->dev->of_node, "realtek,smi-mdio"); + mdio_np = of_get_child_by_name(priv->dev->of_node, "mdio"); if (!mdio_np) { dev_err(priv->dev, "no MDIO bus node\n"); return -ENODEV;