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>
This commit is contained in:
Andrew Goodbody 2025-08-05 12:04:00 +01:00 committed by Jerome Forissier
parent ed3b08874f
commit ff36afe346

View File

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