aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux
diff options
context:
space:
mode:
authorPascal Ernster <git@hardfalcon.net>2023-06-04 21:44:39 +0200
committerSander Vanheule <sander@svanheule.net>2023-07-01 20:25:48 +0200
commit171e67e2f792dd0b3c757b2fd5c804244584cf0c (patch)
treedf0ba5728651d2ee5d39671e5a804ba1288822fb /target/linux
parent8b2f654d4ca4db4204803c37610ed29a19198638 (diff)
downloadupstream-171e67e2f792dd0b3c757b2fd5c804244584cf0c.tar.gz
upstream-171e67e2f792dd0b3c757b2fd5c804244584cf0c.tar.bz2
upstream-171e67e2f792dd0b3c757b2fd5c804244584cf0c.zip
realtek: Use ADVERTISE_* and MII_PHYSID* from <linux/mii.h>
Replace BIT(x) and numerical values in drivers/net/phy/rtl83xx-phy.c with constants from <linux/mii.h> to improve code readability. To make reviewing easier, this commit only addresses ADVERTISE_* and MII_PHYSID* constants. Signed-off-by: Pascal Ernster <git@hardfalcon.net>
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
index 8e3fd3e3fe7..33c929e41ad 100644
--- a/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-5.15/drivers/net/phy/rtl83xx-phy.c
@@ -221,9 +221,9 @@ int rtl839x_read_sds_phy(int phy_addr, int phy_reg)
* which would otherwise read as 0.
*/
if (soc_info.id == 0x8393) {
- if (phy_reg == 2)
+ if (phy_reg == MII_PHYSID1)
return 0x1c;
- if (phy_reg == 3)
+ if (phy_reg == MII_PHYSID2)
return 0x8393;
}
@@ -495,10 +495,10 @@ static int rtl8226_advertise_aneg(struct phy_device *phydev)
if (v < 0)
goto out;
- v |= BIT(5); /* HD 10M */
- v |= BIT(6); /* FD 10M */
- v |= BIT(7); /* HD 100M */
- v |= BIT(8); /* FD 100M */
+ v |= ADVERTISE_10HALF;
+ v |= ADVERTISE_10FULL;
+ v |= ADVERTISE_100HALF;
+ v |= ADVERTISE_100FULL;
ret = phy_write_mmd(phydev, MMD_AN, 16, v);
@@ -506,7 +506,7 @@ static int rtl8226_advertise_aneg(struct phy_device *phydev)
v = phy_read_mmd(phydev, MMD_VEND2, 0xA412);
if (v < 0)
goto out;
- v |= BIT(9); /* FD 1000M */
+ v |= ADVERTISE_1000FULL;
ret = phy_write_mmd(phydev, MMD_VEND2, 0xA412, v);
if (ret < 0)