mirror of
https://github.com/torvalds/linux.git
synced 2026-05-05 23:05:25 -04:00
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: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
a76568865c
commit
876e52b2d3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user