net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 5 Jun 2017 11:22:55 +0000 (12:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:48:22 +0000 (19:48 +0200)
commite9399672360e6ecdcb6a9ebfe88e156922d1694c
tree75e1c4e761532e18ce7c77f26e974f4b912a263b
parent085da766de30ca002dc226fb9d90f58b58e73312
net: phy: avoid genphy_aneg_done() for PHYs without clause 22 support

[ Upstream commit 41408ad519f7a2a1c5229e61f2a97f4df1b61adc ]

Avoid calling genphy_aneg_done() for PHYs that do not implement the
Clause 22 register set.

Clause 45 PHYs may implement the Clause 22 register set along with the
Clause 22 extension MMD.  Hence, we can't simply block access to the
Clause 22 functions based on the PHY being a Clause 45 PHY.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/phy/phy.c