Thread (32 messages) 32 messages, 8 authors, 2020-10-07

Re: [net-next PATCH v1 3/7] net: phy: Introduce fwnode_get_phy_id()

From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Date: 2020-09-30 18:07:54
Also in: linux-acpi, linux-arm-kernel, lkml

On Wed, Sep 30, 2020 at 06:34:40PM +0200, Andrew Lunn wrote:
quoted
@@ -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?
Compatibility with the DT version - note that "phy" and "phy-device"
are only used for non-ACPI fwnodes. This should allow us to convert
drivers where necessary without fear of causing DT regressions.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help