From: Biju Das Date: Wed, 5 Feb 2025 12:42:23 +0000 (+0000) Subject: net: dsa: sja1105: Use of_get_available_child_by_name() X-Git-Tag: v6.15-rc1~160^2~377^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a76568865c1562b33176bf37d43e2b976c046931;p=thirdparty%2Fkernel%2Flinux.git net: dsa: sja1105: Use of_get_available_child_by_name() Use the helper of_get_available_child_by_name() to simplify sja1105_mdiobus_register(). Signed-off-by: Biju Das Reviewed-by: Simon Horman Signed-off-by: David S. Miller --- diff --git a/drivers/net/dsa/sja1105/sja1105_mdio.c b/drivers/net/dsa/sja1105/sja1105_mdio.c index 84b7169f29748..8d535c033cef7 100644 --- a/drivers/net/dsa/sja1105/sja1105_mdio.c +++ b/drivers/net/dsa/sja1105/sja1105_mdio.c @@ -468,13 +468,10 @@ int sja1105_mdiobus_register(struct dsa_switch *ds) if (rc) return rc; - mdio_node = of_get_child_by_name(switch_node, "mdios"); + mdio_node = of_get_available_child_by_name(switch_node, "mdios"); if (!mdio_node) return 0; - if (!of_device_is_available(mdio_node)) - goto out_put_mdio_node; - if (regs->mdio_100base_tx != SJA1105_RSV_ADDR) { rc = sja1105_mdiobus_base_tx_register(priv, mdio_node); if (rc) @@ -487,7 +484,6 @@ int sja1105_mdiobus_register(struct dsa_switch *ds) goto err_free_base_tx_mdiobus; } -out_put_mdio_node: of_node_put(mdio_node); return 0;