As of now RTL839x devices have never more than 32 devices on one
mdio bus. Harden the phy address check during probing.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/23186
Signed-off-by: Robert Marko <robimarko@gmail.com>
return dev_err_probe(dev, -EINVAL, "%pfwP no phy address\n",
of_fwnode_handle(phy));
- /* relaxed check as RTL839x uses MDIO addresses 0..51 */
- if (smi_addr >= ctrl->cfg->num_phys)
+ if (smi_addr >= PHY_MAX_ADDR)
return dev_err_probe(dev, -EINVAL, "%pfwP illegal phy address\n",
of_fwnode_handle(phy));