From: Markus Stockhausen Date: Thu, 9 Apr 2026 16:24:38 +0000 (+0200) Subject: realtek: mdio: align defines with upstream X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3da0b15dc8ac45b4c312cc02eb942c4aa1de4ef8;p=thirdparty%2Fopenwrt.git realtek: mdio: align defines with upstream Align the max defines to upstream. For this - rename PHY to PORT (that is what it is really about= - use plural name (e.g. BUSSES instead of BUS) Signed-off-by: Markus Stockhausen Link: https://github.com/openwrt/openwrt/pull/22866 Signed-off-by: Hauke Mehrtens --- diff --git a/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c b/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c index fc22f18bf14..39fa632303c 100644 --- a/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/mdio/mdio-realtek-otto.c @@ -10,8 +10,9 @@ #include #include -#define RTMDIO_MAX_PHY 57 -#define RTMDIO_MAX_SMI_BUS 4 +#define RTMDIO_MAX_PORTS 57 +#define RTMDIO_MAX_SMI_BUSSES 4 + #define RTMDIO_PAGE_SELECT 0x1f #define RTMDIO_PHY_AQR113C_A 0x31c31c12 @@ -109,7 +110,7 @@ #define RTMDIO_931X_SMI_10GPHY_POLLING_SEL4 (0x0D00) #define for_each_port(ctrl, pn) \ - for_each_set_bit(pn, ctrl->valid_ports, RTMDIO_MAX_PHY) + for_each_set_bit(pn, ctrl->valid_ports, RTMDIO_MAX_PORTS) #define rtmdio_ctrl_from_bus(bus) \ (((struct rtmdio_chan *)(bus)->priv)->ctrl) @@ -192,9 +193,9 @@ struct rtmdio_ctrl { struct mutex lock; struct regmap *map; const struct rtmdio_config *cfg; - struct rtmdio_port port[RTMDIO_MAX_PHY]; - struct rtmdio_bus bus[RTMDIO_MAX_SMI_BUS]; - DECLARE_BITMAP(valid_ports, RTMDIO_MAX_PHY); + struct rtmdio_port port[RTMDIO_MAX_PORTS]; + struct rtmdio_bus bus[RTMDIO_MAX_SMI_BUSSES]; + DECLARE_BITMAP(valid_ports, RTMDIO_MAX_PORTS); }; struct rtmdio_chan { @@ -744,7 +745,7 @@ static int rtmdio_930x_setup_ctrl(struct rtmdio_ctrl *ctrl) unsigned int mask, val; /* Define C22/C45 bus feature set */ - for (int smi_bus = 0; smi_bus < RTMDIO_MAX_SMI_BUS; smi_bus++) { + for (int smi_bus = 0; smi_bus < RTMDIO_MAX_SMI_BUSSES; smi_bus++) { mask = BIT(16 + smi_bus); val = ctrl->bus[smi_bus].is_c45 ? mask : 0; regmap_update_bits(ctrl->map, RTMDIO_930X_SMI_GLB_CTRL, mask, val); @@ -800,7 +801,7 @@ static int rtmdio_931x_setup_ctrl(struct rtmdio_ctrl *ctrl) msleep(100); /* Define C22/C45 bus feature set */ - for (int smi_bus = 0; smi_bus < RTMDIO_MAX_SMI_BUS; smi_bus++) { + for (int smi_bus = 0; smi_bus < RTMDIO_MAX_SMI_BUSSES; smi_bus++) { if (ctrl->bus[smi_bus].is_c45) c45_mask |= 0x2 << (smi_bus * 2); /* Std. C45, non-standard is 0x3 */ } @@ -907,7 +908,7 @@ static int rtmdio_map_ports(struct device *dev) return dev_err_probe(dev, -EINVAL, "%pfwP no bus address\n", of_fwnode_handle(phy->parent)); - if (smi_bus >= RTMDIO_MAX_SMI_BUS) + if (smi_bus >= RTMDIO_MAX_SMI_BUSSES) return dev_err_probe(dev, -EINVAL, "%pfwP illegal bus number\n", of_fwnode_handle(phy->parent));