> +static int dpaa2_pcs_create(struct dpaa2_mac *mac,
> +                         struct device_node *dpmac_node, int id)
> +{
> +     struct mdio_device *mdiodev;
> +     struct device_node *node;
> +
> +     node = of_parse_phandle(dpmac_node, "pcs-handle", 0);
> +     if (!node) {
> +             /* do not error out on old DTS files */
> +             netdev_warn(mac->net_dev, "pcs-handle node not found\n");
> +             return 0;
> +     }
> +
> +     if (!of_device_is_available(node) ||
> +         !of_device_is_available(node->parent)) {
> +             netdev_err(mac->net_dev, "pcs-handle node not available\n");
> +             return -ENODEV;
> +     }

Can a child be available when its parent is not? I've no idea!

Reviewed-by: Andrew Lunn <and...@lunn.ch>

    Andrew

Reply via email to