Skip to content

Commit 70a0da8

Browse files
aspeedJackykuba-moo
authored andcommitted
net: ftgmac100: fixed not check status from fixed phy
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(). Fixes: e24a6c8 ("net: ftgmac100: Get link speed and duplex for NC-SI") Signed-off-by: Jacky Chou <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 983e35c commit 70a0da8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/net/ethernet/faraday/ftgmac100.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,12 @@ static int ftgmac100_probe(struct platform_device *pdev)
19061906
goto err_phy_connect;
19071907
}
19081908

1909-
phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, NULL);
1909+
phydev = fixed_phy_register(PHY_POLL, &ncsi_phy_status, np);
1910+
if (IS_ERR(phydev)) {
1911+
dev_err(&pdev->dev, "failed to register fixed PHY device\n");
1912+
err = PTR_ERR(phydev);
1913+
goto err_phy_connect;
1914+
}
19101915
err = phy_connect_direct(netdev, phydev, ftgmac100_adjust_link,
19111916
PHY_INTERFACE_MODE_MII);
19121917
if (err) {

0 commit comments

Comments
 (0)