[PATCH 1/6] net: phy: Add fallbacks for the obsoletes phy DT properties

Ezequiel Garcia ezequiel.garcia at free-electrons.com
Tue Jul 29 13:44:56 PDT 2014


In addition to the standard 'phy-handle' devicetree property, the binding
specifies two properties, which are considered obsolete: 'phy' and 'phy-device'.
This commit adds support for them in of_mdio_find_phy().

Signed-off-by: Ezequiel Garcia <ezequiel.garcia at free-electrons.com>
---
 drivers/net/phy/phy.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index 1a2fdf1..cad4cf5 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -275,6 +275,10 @@ static struct phy_device *of_mdio_find_phy(struct eth_device *edev)
 
 	phy_node = of_parse_phandle(edev->parent->device_node, "phy-handle", 0);
 	if (!phy_node)
+		phy_node = of_parse_phandle(edev->parent->device_node, "phy", 0);
+	if (!phy_node)
+		phy_node = of_parse_phandle(edev->parent->device_node, "phy-device", 0);
+	if (!phy_node)
 		return NULL;
 
 	bus_for_each_device(&mdio_bus_type, dev) {
-- 
2.0.1




More information about the barebox mailing list