From: Radhey Shyam Pandey Date: Wed, 20 Apr 2022 11:03:10 +0000 (+0530) Subject: net: macb: In ZynqMP initialization make SGMII phy configuration optional X-Git-Tag: v5.18.3~783 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=54261314ee66a77391e0171477f3e3ff95730d06;p=thirdparty%2Fkernel%2Fstable.git net: macb: In ZynqMP initialization make SGMII phy configuration optional [ Upstream commit 29e96fe9e0ec0f0fe1dd306a4ccb7b8983eae67a ] In the macb binding documentation "phys" is an optional property. Make implementation in line with it. This change allows the traditional flow in which first stage bootloader does PS-GT configuration to work along with newer use cases in which PS-GT configuration is managed by the phy-zynqmp driver. It fixes below macb probe failure when macb DT node doesn't have SGMII phys handle. "macb ff0b0000.ethernet: error -ENODEV: failed to get PS-GTR PHY" Signed-off-by: Radhey Shyam Pandey Reviewed-by: Michal Simek Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index 61284baa0496e..ed7c2c2c44011 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4594,7 +4594,7 @@ static int zynqmp_init(struct platform_device *pdev) if (bp->phy_interface == PHY_INTERFACE_MODE_SGMII) { /* Ensure PS-GTR PHY device used in SGMII mode is ready */ - bp->sgmii_phy = devm_phy_get(&pdev->dev, "sgmii-phy"); + bp->sgmii_phy = devm_phy_optional_get(&pdev->dev, NULL); if (IS_ERR(bp->sgmii_phy)) { ret = PTR_ERR(bp->sgmii_phy);