Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Biju Das and committed by
David S. Miller
76c82eb0 1364004b

+1 -6
+1 -6
drivers/net/ethernet/actions/owl-emac.c
··· 1325 1325 struct device_node *mdio_node; 1326 1326 int ret; 1327 1327 1328 - mdio_node = of_get_child_by_name(dev->of_node, "mdio"); 1328 + mdio_node = of_get_available_child_by_name(dev->of_node, "mdio"); 1329 1329 if (!mdio_node) 1330 1330 return -ENODEV; 1331 - 1332 - if (!of_device_is_available(mdio_node)) { 1333 - ret = -ENODEV; 1334 - goto err_put_node; 1335 - } 1336 1331 1337 1332 priv->mii = devm_mdiobus_alloc(dev); 1338 1333 if (!priv->mii) {