Commit 876e52b2 authored by Biju Das's avatar Biju Das Committed by David S. Miller
Browse files

net: ethernet: mtk-star-emac: Use of_get_available_child_by_name()



Use the helper of_get_available_child_by_name() to simplify
mtk_star_mdio_init().

Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a7656886
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1427,15 +1427,10 @@ static int mtk_star_mdio_init(struct net_device *ndev)

	of_node = dev->of_node;

	mdio_node = of_get_child_by_name(of_node, "mdio");
	mdio_node = of_get_available_child_by_name(of_node, "mdio");
	if (!mdio_node)
		return -ENODEV;

	if (!of_device_is_available(mdio_node)) {
		ret = -ENODEV;
		goto out_put_node;
	}

	priv->mii = devm_mdiobus_alloc(dev);
	if (!priv->mii) {
		ret = -ENOMEM;