Commit 76c82eb0 authored by Biju Das's avatar Biju Das Committed by David S. Miller
Browse files

net: ethernet: actions: Use of_get_available_child_by_name()



Use the helper of_get_available_child_by_name() to simplify
owl_emac_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 1364004b
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -1325,15 +1325,10 @@ static int owl_emac_mdio_init(struct net_device *netdev)
	struct device_node *mdio_node;
	int ret;

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

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

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