]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: platform: fix probe for ACPI devices
authorAjay Gupta <ajayg@nvidia.com>
Thu, 23 Jan 2020 01:16:35 +0000 (17:16 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 25 Jan 2020 09:09:47 +0000 (10:09 +0100)
Use generic device API to get phy mode to fix probe failure
with ACPI based devices.

Signed-off-by: Ajay Gupta <ajayg@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index 4775f49d7f3b716fcee15cc5401b79f1e87112cf..d10ac54bf385adb1e968a28cc9593397d56c1156 100644 (file)
@@ -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)