net: ftgmac100: fixed not check status from fixed phy
Subsystems (2)
Add error handling from calling fixed_phy_register. It may return some error, therefore, need to check the status.
And fixed_phy_register needs to bind a device node for mdio. Add the mac device node for fixed_phy_register function. This is a reference to this function, of_phy_register_fixed_link().
--- drivers/net/ethernet/faraday/ftgmac100.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/faraday/ftgmac100.c +6 -1
@@ -1906,7 +1906,12 @@ static int ftgmac100_probe(struct platform_device *pdev) goto err_phy_connect; } - phydev =fixed_phy_register (PHY_POLL , &ncsi_phy_status,NULL ); + phydev =fixed_phy_register (PHY_POLL , &ncsi_phy_status, np); +if (IS_ERR (phydev)) { +dev_err (&pdev->dev,"failed to register fixed PHY device\n" ); + err =PTR_ERR (phydev); + goto err_phy_connect; + } err =phy_connect_direct (netdev, phydev, ftgmac100_adjust_link,PHY_INTERFACE_MODE_MII );if (err) {
Signature · 1 line
2.25.1
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Mon, 7 Oct 2024 11:24:35 +0800 you wrote:
Add error handling from calling
fixed_phy_register. It may return some error, therefore, need to check the status.And
fixed_phy_registerneeds to bind a device node for mdio. Add the mac device node forfixed_phy_registerfunction. This is a reference to this function,of_phy_register_fixed_link().[...]
Here is the summary with links:
- [net] net: ftgmac100: fixed not check status from fixed phy
https://git.kernel.org/netdev/net/c/70a0da8c1135
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html