]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: micrel: Fix detection of ksz87xx switch
authorSteve Bennett <steveb@workware.net.au>
Fri, 30 Jul 2021 22:57:50 +0000 (08:57 +1000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 2 Aug 2021 14:07:49 +0000 (15:07 +0100)
commitc4f576839861fe8be9695f19c594b95281eee9db
treec38d2223384587a4931d19bbf0060872e3480833
parent8e45f33479fd1b6f275c9fdcbe4b0afbe4a7cd80
net: phy: micrel: Fix detection of ksz87xx switch

The logic for discerning between KSZ8051 and KSZ87XX PHYs is incorrect
such that the that KSZ87XX switch is not identified correctly.

ksz8051_ksz8795_match_phy_device() uses the parameter ksz_phy_id
to discriminate whether it was called from ksz8051_match_phy_device()
or from ksz8795_match_phy_device() but since PHY_ID_KSZ87XX is the
same value as PHY_ID_KSZ8051, this doesn't work.

Instead use a bool to discriminate the caller.

Without this patch, the KSZ8795 switch port identifies as:

ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver [Generic PHY]

With the patch, it identifies correctly:

ksz8795-switch spi3.1 ade1 (uninitialized): PHY [dsa-0.1:03] driver [Micrel KSZ87XX Switch]

Fixes: 8f4eb26885f0e4f9c95f ("net: phy: micrel: Discern KSZ8051 and KSZ8795 PHYs")
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Reviewed-by: Marek Vasut <marex@denx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c