diff mbox series

[2/2] net: macb: In ZynqMP initialization make SGMII phy configuration optional

Message ID 1650452590-32948-3-git-send-email-radhey.shyam.pandey@xilinx.com (mailing list archive)
State Accepted
Commit 29e96fe9e0ec0f0fe1dd306a4ccb7b8983eae67a
Delegated to: Netdev Maintainers
Headers show
Series net: macb: Make ZynqMP SGMII phy configuration optional | expand

Checks

Context Check Description
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Series has a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 25 this patch: 25
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 25 this patch: 25
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/tree_selection success Guessing tree name failed - patch did not apply

Commit Message

Radhey Shyam Pandey April 20, 2022, 11:03 a.m. UTC
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 <radhey.shyam.pandey@xilinx.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michal Simek April 20, 2022, 11:17 a.m. UTC | #1
On 4/20/22 13:03, Radhey Shyam Pandey wrote:
> 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 <radhey.shyam.pandey@xilinx.com>
> ---
>   drivers/net/ethernet/cadence/macb_main.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index a5140d4d3baf..6434e74c04f1 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -4588,7 +4588,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);

Reviewed-by: Michal Simek <michal.simek@xilinx.com>

Thanks,
Michal
diff mbox series

Patch

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index a5140d4d3baf..6434e74c04f1 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -4588,7 +4588,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);