Commit 1364004b authored by Biju Das's avatar Biju Das Committed by David S. Miller
Browse files

net: ethernet: mtk_eth_soc: Use of_get_available_child_by_name()



Use the helper of_get_available_child_by_name() to simplify
mtk_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 876e52b2
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -830,17 +830,12 @@ static int mtk_mdio_init(struct mtk_eth *eth)
	int ret;
	u32 val;

	mii_np = of_get_child_by_name(eth->dev->of_node, "mdio-bus");
	mii_np = of_get_available_child_by_name(eth->dev->of_node, "mdio-bus");
	if (!mii_np) {
		dev_err(eth->dev, "no %s child node found", "mdio-bus");
		return -ENODEV;
	}

	if (!of_device_is_available(mii_np)) {
		ret = -ENODEV;
		goto err_put_node;
	}

	eth->mii_bus = devm_mdiobus_alloc(eth->dev);
	if (!eth->mii_bus) {
		ret = -ENOMEM;