net: stmmac: honor error code from stmmac_dt_phy()
authorNiklas Cassel <niklas.cassel@axis.com>
Mon, 19 Feb 2018 17:11:15 +0000 (18:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 20 Feb 2018 19:13:22 +0000 (14:13 -0500)
Honor error code from stmmac_dt_phy() instead of always
returning -ENODEV.

No functional change intended.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

index bcfac84cf6fb1b1e0665e54931ae7780c39472a6..ebd3e5ffa73cc54bb54a073b97961314550d30a0 100644 (file)
@@ -417,8 +417,9 @@ stmmac_probe_config_dt(struct platform_device *pdev, const char **mac)
                dev_warn(&pdev->dev, "snps,phy-addr property is deprecated\n");
 
        /* To Configure PHY by using all device-tree supported properties */
-       if (stmmac_dt_phy(plat, np, &pdev->dev))
-               return ERR_PTR(-ENODEV);
+       rc = stmmac_dt_phy(plat, np, &pdev->dev);
+       if (rc)
+               return ERR_PTR(rc);
 
        of_property_read_u32(np, "tx-fifo-depth", &plat->tx_fifo_size);