Errors are not indicated by the phy_mode value but returned separately
from the function.
Signed-off-by: David Bauer <mail@david-bauer.net>
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,10,0)
}
#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);
#else
ag->phy_if_mode = of_get_phy_mode(np);
if (ag->phy_if_mode < 0) {
if (ag->phy_if_mode < 0) {
dev_err(&pdev->dev, "missing phy-mode property in DT\n");
return ag->phy_if_mode;
}
dev_err(&pdev->dev, "missing phy-mode property in DT\n");
return ag->phy_if_mode;
}