summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Stockhausen2026-01-26 13:34:07 +0000
committerHauke Mehrtens2026-01-27 23:28:15 +0000
commit38fea332d9fd805bc13a7ebc20c6d23c4e105532 (patch)
treea3a096a2572d076a47a4e8e7aec888257703c9bc
parentc2a387138788125a4386fd50e2b90de3cd5b9944 (diff)
downloadopenwrt-38fea332d9fd805bc13a7ebc20c6d23c4e105532.tar.gz
realtek: phy: replace hard coded pages 30/31 with define
Some of the code forgot to use the register defines for page selection. Replace the hard coded values with their define. Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21716 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
-rw-r--r--target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
index 475a628de9..428fdb7d53 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
@@ -127,18 +127,18 @@ static int rtl821x_match_phy_device(struct phy_device *phydev)
* during detection.
*/
- oldpage = mdiobus_read(bus, addr, 0x1f);
- oldxpage = mdiobus_read(bus, addr, 0x1e);
+ oldpage = mdiobus_read(bus, addr, RTL821x_PAGE_SELECT);
+ oldxpage = mdiobus_read(bus, addr, RTL821x_EXT_PAGE_SELECT);
- mdiobus_write(bus, addr, 0x1e, 0x8);
- mdiobus_write(bus, addr, 0x1f, 0x278);
+ mdiobus_write(bus, addr, RTL821x_EXT_PAGE_SELECT, 0x8);
+ mdiobus_write(bus, addr, RTL821x_PAGE_SELECT, 0x278);
mdiobus_write(bus, addr, 0x12, 0x455);
- mdiobus_write(bus, addr, 0x1f, 0x260);
+ mdiobus_write(bus, addr, RTL821x_PAGE_SELECT, 0x260);
chip_mode = mdiobus_read(bus, addr, 0x12);
dev_dbg(&phydev->mdio.dev, "got RTL8218B/RTL8214Fx chip mode %04x\n", chip_mode);
- mdiobus_write(bus, addr, 0x1e, oldxpage);
- mdiobus_write(bus, addr, 0x1f, oldpage);
+ mdiobus_write(bus, addr, RTL821x_EXT_PAGE_SELECT, oldxpage);
+ mdiobus_write(bus, addr, RTL821x_PAGE_SELECT, oldpage);
/* no values while reading the 5th port during 5-8th port detection of RTL8218B */
if (!chip_mode)