aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/phy/phy_device.c
diff options
context:
space:
mode:
authorHeiner Kallweit <hkallweit1@gmail.com>2019-02-08 19:25:22 +0100
committerDavid S. Miller <davem@davemloft.net>2019-02-08 23:10:42 -0800
commit3b5e74e0afe3382f9354b657714ac40673b7c597 (patch)
treed590b412148eb3f8ba5713a8681c9fbe4421578d /drivers/net/phy/phy_device.c
parentMerge branch 'mvpp2-phylink-fixes' (diff)
downloadlinux-dev-3b5e74e0afe3382f9354b657714ac40673b7c597.tar.xz
linux-dev-3b5e74e0afe3382f9354b657714ac40673b7c597.zip
net: phy: disregard "Clause 22 registers present" bit in get_phy_c45_devs_in_pkg
Bit 0 in register 1.5 doesn't represent a device but is a flag that Clause 22 registers are present. Therefore disregard this bit when populating the device list. If code needs this information it should read register 1.5 directly instead of accessing the device list. Because this bit doesn't represent a device don't define a MDIO_MMD_XYZ constant, just define a MDIO_DEVS_XYZ constant for the flag in the device list bitmap. v2: - make masking of bit 0 more explicit - improve commit message Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/phy_device.c')
-rw-r--r--drivers/net/phy/phy_device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 9369e1323c39..d4fc1fd8af41 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -684,6 +684,9 @@ static int get_phy_c45_devs_in_pkg(struct mii_bus *bus, int addr, int dev_addr,
return -EIO;
*devices_in_package |= (phy_reg & 0xffff);
+ /* Bit 0 doesn't represent a device, it indicates c22 regs presence */
+ *devices_in_package &= ~BIT(0);
+
return 0;
}