Message ID | ff374a57-3976-020f-feb5-49a45662b56c@gmail.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | net: phy: disregard "Clause 22 registers present" bit in get_phy_c45_devs_in_pkg | expand |
On Fri, Feb 08, 2019 at 08:21:24PM +0100, Heiner Kallweit wrote: > 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. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index 82dd72954..31f9e7c49 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; + /* Bit 0 doesn't represent a device, it indicates c22 regs presence */ + *devices_in_package &= ~BIT(0); + return 0; }
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. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- drivers/net/phy/phy_device.c | 3 +++ 1 file changed, 3 insertions(+)