Commit b08412a9 authored by Michael Walle's avatar Michael Walle Committed by Greg Kroah-Hartman
Browse files

net: phy: mxl-gpy: fix version reporting

[ Upstream commit fc3dd036 ]

The commit 09ce6b20 ("net: phy: mxl-gpy: add temperature sensor")
will overwrite the return value and the reported version will be wrong.
Fix it.

Fixes: 09ce6b20

 ("net: phy: mxl-gpy: add temperature sensor")
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Stable-dep-of: 5f4d487d

 ("net: phy: mxl-gpy: add MDINT workaround")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent dec5abd9
No related merge requests found
Showing with 6 additions and 5 deletions
+6 -5
......@@ -96,6 +96,7 @@ static int gpy_config_init(struct phy_device *phydev)
static int gpy_probe(struct phy_device *phydev)
{
int fw_version;
int ret;
if (!phydev->is_c45) {
......@@ -105,12 +106,12 @@ static int gpy_probe(struct phy_device *phydev)
}
/* Show GPY PHY FW version in dmesg */
ret = phy_read(phydev, PHY_FWV);
if (ret < 0)
return ret;
fw_version = phy_read(phydev, PHY_FWV);
if (fw_version < 0)
return fw_version;
phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", ret,
(ret & PHY_FWV_REL_MASK) ? "release" : "test");
phydev_info(phydev, "Firmware Version: 0x%04X (%s)\n", fw_version,
(fw_version & PHY_FWV_REL_MASK) ? "release" : "test");
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment