diff options
| author | Markus Stockhausen | 2025-05-02 12:47:22 +0000 |
|---|---|---|
| committer | Stijn Tintel | 2025-05-12 13:09:19 +0000 |
| commit | 10519db5798bee4ef6134e36854712db010b9d35 (patch) | |
| tree | 3cf56f9a0d75c7b7dc4bf773034c8f67504900fd | |
| parent | 7f16a379f698fb7546811f76962875254b1e7293 (diff) | |
realtek: reuse RTMDIO_MAX_SMI_BUS define
Although a dfine is used to set the maxiumum number of SMI
busses (=4) it is not used at all appropriate places in the code.
Replace hard coded constants with that define.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/18402
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
| -rw-r--r-- | target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c index 29c7529469..557df76593 100644 --- a/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c +++ b/target/linux/realtek/files-6.6/drivers/net/ethernet/rtl838x_eth.c @@ -2028,7 +2028,7 @@ static int rtmdio_930x_reset(struct mii_bus *bus) sw_w32_mask(poll_ctrl, 0, RTL930X_SMI_GLB_CTRL); /* Configure which SMI busses are polled in c45 based on a c45 PHY being on that bus */ - for (int i = 0; i < 4; i++) + for (int i = 0; i < RTMDIO_MAX_SMI_BUS; i++) if (priv->smi_bus_isc45[i]) c45_mask |= BIT(i + 16); @@ -2130,7 +2130,7 @@ static int rtmdio_931x_reset(struct mii_bus *bus) } /* Configure which SMI bus is behind which port number */ - for (int i = 0; i < 4; i++) { + for (int i = 0; i < RTMDIO_MAX_SMI_BUS; i++) { pr_info("poll sel %d, %08x\n", i, poll_sel[i]); sw_w32(poll_sel[i], RTL931X_SMI_PORT_POLLING_SEL + (i * 4)); } @@ -2138,7 +2138,7 @@ static int rtmdio_931x_reset(struct mii_bus *bus) /* Configure which SMI busses */ pr_info("%s: WAS RTL931X_MAC_L2_GLOBAL_CTRL2 %08x\n", __func__, sw_r32(RTL931X_MAC_L2_GLOBAL_CTRL2)); pr_info("c45_mask: %08x, RTL931X_SMI_GLB_CTRL0 was %X", c45_mask, sw_r32(RTL931X_SMI_GLB_CTRL0)); - for (int i = 0; i < 4; i++) { + for (int i = 0; i < RTMDIO_MAX_SMI_BUS; i++) { /* bus is polled in c45 */ if (priv->smi_bus_isc45[i]) c45_mask |= 0x2 << (i * 2); /* Std. C45, non-standard is 0x3 */ |