Skip to contentSkip to conversation

net: stmmac: platform: fix probe for ACPI devices

PATCH Applied Ajay Gupta 2 participants 2 messages Jan 23, 2020 – Jan 25, 2020

Subsystems (4)
lore
Share & tools
lore

Ajay Gupta

author
#0 lore raw

PATCH 1/1 net: stmmac: platform: fix probe for ACPI devices

From: Ajay Gupta <[email protected]>

Use generic device API to get phy mode to fix probe failure with ACPI based devices.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 -3
index 4775f49d7f3b..d10ac54bf385 100644
@@ -412,9 +412,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
 		*mac = NULL;
 	}
 
-	rc = of_get_phy_mode(np, &plat->phy_interface);
-	if (rc)
-		return ERR_PTR(rc);
+	plat->phy_interface = device_get_phy_mode(&pdev->dev);
+	if (plat->phy_interface < 0)
+		return ERR_PTR(plat->phy_interface);
 
 	plat->interface = stmmac_of_get_mac_mode(np);
 	if (plat->interface < 0)
Signature · 1 line
2.17.1