aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2025-02-05 12:42:23 +0000
committerDavid S. Miller <davem@davemloft.net>2025-02-07 13:43:55 +0000
commita76568865c1562b33176bf37d43e2b976c046931 (patch)
tree142599eea5bad77c76879fe7472911c91e4b84bb
parentnet: dsa: rzn1_a5psw: Use of_get_available_child_by_name() (diff)
downloadwireguard-linux-a76568865c1562b33176bf37d43e2b976c046931.tar.xz
wireguard-linux-a76568865c1562b33176bf37d43e2b976c046931.zip
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 <biju.das.jz@bp.renesas.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/sja1105/sja1105_mdio.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/net/dsa/sja1105/sja1105_mdio.c b/drivers/net/dsa/sja1105/sja1105_mdio.c
index 84b7169f2974..8d535c033cef 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;