aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79
diff options
context:
space:
mode:
authorDavid Bauer <mail@david-bauer.net>2021-05-03 00:27:59 +0200
committerDavid Bauer <mail@david-bauer.net>2021-05-10 01:19:32 +0200
commita273ac4d610b95de213fc89c713bcf1b4b851b2d (patch)
tree12156dd47bccef011f391cb919953e5b95a882c2 /target/linux/ath79
parent204956aea532b744b2e04142bb39b86129fc5802 (diff)
downloadupstream-a273ac4d610b95de213fc89c713bcf1b4b851b2d.tar.gz
upstream-a273ac4d610b95de213fc89c713bcf1b4b851b2d.tar.bz2
upstream-a273ac4d610b95de213fc89c713bcf1b4b851b2d.zip
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 <mail@david-bauer.net>
Diffstat (limited to 'target/linux/ath79')
-rw-r--r--target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c b/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
index d060568593..463083628f 100644
--- a/target/linux/ath79/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_main.c
+++ b/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;
}