summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Goodbody <andrew.goodbody@linaro.org>2025-08-05 12:04:00 +0100
committerJerome Forissier <jerome.forissier@linaro.org>2025-08-18 15:47:57 +0200
commitff36afe346777f60c461964de1ab00aa6b2edb95 (patch)
treebe02a679d3377b3caa31f5878a0e869e9ff2b7dd
parented3b08874f4c47e287a1f0eb36fc61ff7d778cc9 (diff)
net: mediatek: Use correct variable for return
In mtk_eth_of_to_plat, the last error check has the value in 'priv->phy_addr' but returns ret. Correct to return 'priv->phy_addr' instead. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
-rw-r--r--drivers/net/mtk_eth/mtk_eth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/mtk_eth/mtk_eth.c b/drivers/net/mtk_eth/mtk_eth.c
index 5d6a42bceb4..b172838ba3a 100644
--- a/drivers/net/mtk_eth/mtk_eth.c
+++ b/drivers/net/mtk_eth/mtk_eth.c
@@ -1461,7 +1461,7 @@ static int mtk_eth_of_to_plat(struct udevice *dev)
priv->phy_addr = ofnode_read_s32_default(args.node, "reg", -1);
if (priv->phy_addr < 0) {
printf("error: phy address is not specified\n");
- return ret;
+ return priv->phy_addr;
}
}