> +/* Extract the phy ID from the compatible string of the form > + * ethernet-phy-idAAAA.BBBB. > + */ > +int fwnode_get_phy_id(struct fwnode_handle *fwnode, u32 *phy_id) > +{ > + unsigned int upper, lower; > + const char *cp; > + int ret; > + > + ret = fwnode_property_read_string(fwnode, "compatible", &cp); > + if (ret) > + return ret; > + > + if (sscanf(cp, "ethernet-phy-id%4x.%4x", &upper, &lower) == 2) { > + *phy_id = ((upper & 0xFFFF) << 16) | (lower & 0xFFFF); > + return 0; > + } > + return -EINVAL; > +} > +EXPORT_SYMBOL(fwnode_get_phy_id); Hi Calvin Do you really need this? Do you have a board with a broken PHY ID? > /** > * get_phy_device - reads the specified PHY device and returns its @phy_device > * struct > @@ -2866,7 +2888,15 @@ EXPORT_SYMBOL_GPL(device_phy_find_device); > */ > struct fwnode_handle *fwnode_get_phy_node(struct fwnode_handle *fwnode) > { > - return fwnode_find_reference(fwnode, "phy-handle", 0); > + struct fwnode_handle *phy_node; > + > + phy_node = fwnode_find_reference(fwnode, "phy-handle", 0); > + if (is_acpi_node(fwnode) || !IS_ERR(phy_node)) > + return phy_node; > + phy_node = fwnode_find_reference(fwnode, "phy", 0); > + if (IS_ERR(phy_node)) > + phy_node = fwnode_find_reference(fwnode, "phy-device", 0); > + return phy_node; Why do you have three different ways to reference a PHY? Andrew