Commit 0584a917 authored by Biju Das's avatar Biju Das Committed by David S. Miller
Browse files

net: ibm: emac: Use of_get_available_child_by_name()



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

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 76c82eb0
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -2554,17 +2554,12 @@ static int emac_dt_mdio_probe(struct emac_instance *dev)
	struct mii_bus *bus;
	int res;

	mii_np = of_get_child_by_name(dev->ofdev->dev.of_node, "mdio");
	mii_np = of_get_available_child_by_name(dev->ofdev->dev.of_node, "mdio");
	if (!mii_np) {
		dev_err(&dev->ofdev->dev, "no mdio definition found.");
		return -ENODEV;
	}

	if (!of_device_is_available(mii_np)) {
		res = -ENODEV;
		goto put_node;
	}

	bus = devm_mdiobus_alloc(&dev->ofdev->dev);
	if (!bus) {
		res = -ENOMEM;