소스 검색

ath79: ag71xx: fix error handling for of_get_phy_mode

Errors are not indicated by the phy_mode value but returned separately
from the function.

Signed-off-by: David Bauer <[email protected]>
David Bauer 4 년 전
부모
커밋
a273ac4d61
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

+ 3 - 3
target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c

@@ -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;
 	}