Skip to content

Commit

Permalink
dpaa2-mac: do not check for both child and parent DTS nodes
Browse files Browse the repository at this point in the history
There is no need to check if both the MDIO controller node and its
child node, the PCS device, are available since there is no chance that
the child node would be enabled when the parent it's not.

Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ioana Ciornei authored and David S. Miller committed Sep 26, 2020
1 parent bd0b68a commit 9817970
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ static int dpaa2_pcs_create(struct dpaa2_mac *mac,
return 0;
}

if (!of_device_is_available(node) ||
!of_device_is_available(node->parent)) {
if (!of_device_is_available(node)) {
netdev_err(mac->net_dev, "pcs-handle node not available\n");
return -ENODEV;
}
Expand Down

0 comments on commit 9817970

Please sign in to comment.