On Thu, Sep 24, 2020 at 03:10:51AM +0200, Andrew Lunn wrote: > > +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! >
One can definitely try and enable the child node from DTS while keeping the parent disabled but what seems to be the outcome is that the disabled state will trickle down from the parent node to all child nodes. This check is just a little more cautious than absolutely necessary. Ioana