netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: micrel: Fix detection of ksz87xx switch
@ 2021-07-30 10:51 Steve Bennett
  2021-07-30 16:59 ` Jakub Kicinski
  2021-07-30 22:57 ` [PATCH v2] " Steve Bennett
  0 siblings, 2 replies; 10+ messages in thread
From: Steve Bennett @ 2021-07-30 10:51 UTC (permalink / raw)
  To: netdev, linux-kernel; +Cc: Steve Bennett

The previous logic was wrong such that the ksz87xx
switch was not identified correctly.

Signed-off-by: Steve Bennett <steveb@workware.net.au>
---
 drivers/net/phy/micrel.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c
index 4d53886f7d51..a4acec02c8cb 100644
--- a/drivers/net/phy/micrel.c
+++ b/drivers/net/phy/micrel.c
@@ -401,11 +401,11 @@ static int ksz8041_config_aneg(struct phy_device *phydev)
 }
 
 static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
-					    const u32 ksz_phy_id)
+					    const u32 ksz_8051)
 {
 	int ret;
 
-	if ((phydev->phy_id & MICREL_PHY_ID_MASK) != ksz_phy_id)
+	if ((phydev->phy_id & MICREL_PHY_ID_MASK) != PHY_ID_KSZ8051)
 		return 0;
 
 	ret = phy_read(phydev, MII_BMSR);
@@ -418,7 +418,7 @@ static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
 	 * the switch does not.
 	 */
 	ret &= BMSR_ERCAP;
-	if (ksz_phy_id == PHY_ID_KSZ8051)
+	if (ksz_8051)
 		return ret;
 	else
 		return !ret;
@@ -426,7 +426,7 @@ static int ksz8051_ksz8795_match_phy_device(struct phy_device *phydev,
 
 static int ksz8051_match_phy_device(struct phy_device *phydev)
 {
-	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ8051);
+	return ksz8051_ksz8795_match_phy_device(phydev, 1);
 }
 
 static int ksz8081_config_init(struct phy_device *phydev)
@@ -535,7 +535,7 @@ static int ksz8061_config_init(struct phy_device *phydev)
 
 static int ksz8795_match_phy_device(struct phy_device *phydev)
 {
-	return ksz8051_ksz8795_match_phy_device(phydev, PHY_ID_KSZ87XX);
+	return ksz8051_ksz8795_match_phy_device(phydev, 0);
 }
 
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
-- 
2.24.2 (Apple Git-127)


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-08-08 22:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-30 10:51 [PATCH] net: phy: micrel: Fix detection of ksz87xx switch Steve Bennett
2021-07-30 16:59 ` Jakub Kicinski
2021-07-30 22:19   ` Steve Bennett
2021-08-07  0:01     ` Ben Hutchings
2021-08-07  0:06       ` [PATCH net] net: phy: micrel: Fix link detection on ksz87xx switch" Ben Hutchings
2021-08-08 11:10         ` patchwork-bot+netdevbpf
2021-08-08 22:18       ` [PATCH] net: phy: micrel: Fix detection of ksz87xx switch Steve Bennett
2021-07-30 22:57 ` [PATCH v2] " Steve Bennett
2021-07-30 23:08   ` Marek Vasut
2021-08-02 14:10   ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).