Skip to content

Commit

Permalink
ath79: ag71xx: fix error handling for of_get_phy_mode
Browse files Browse the repository at this point in the history
Errors are not indicated by the phy_mode value but returned separately
from the function.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed May 9, 2021
1 parent 204956a commit a273ac4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1677,12 +1677,12 @@ static int ag71xx_probe(struct platform_device *pdev)
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)
of_get_phy_mode(np, &ag->phy_if_mode);
err = of_get_phy_mode(np, &ag->phy_if_mode);
if (err < 0) {
#else
ag->phy_if_mode = of_get_phy_mode(np);
#endif

if (ag->phy_if_mode < 0) {
#endif
dev_err(&pdev->dev, "missing phy-mode property in DT\n");
return ag->phy_if_mode;
}
Expand Down

0 comments on commit a273ac4

Please sign in to comment.