]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: initialise phydev speed and duplex sanely
authorRussell King <rmk+kernel@armlinux.org.uk>
Fri, 22 Nov 2019 15:23:23 +0000 (15:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:40:08 +0000 (13:40 +0100)
commit5baa2f382b4ac6de7953d49170aca4ab1e412d97
tree691f30c128599f421484496dbdb532e18a046e55
parent9d47b11b7419aa6b1515999f25a0846ff4b73a7d
net: phy: initialise phydev speed and duplex sanely

[ Upstream commit a5d66f810061e2dd70fb7a108dcd14e535bc639f ]

When a phydev is created, the speed and duplex are set to zero and
-1 respectively, rather than using the predefined SPEED_UNKNOWN and
DUPLEX_UNKNOWN constants.

There is a window at initialisation time where we may report link
down using the 0/-1 values.  Tidy this up and use the predefined
constants, so debug doesn't complain with:

"Unsupported (update phy-core.c)/Unsupported (update phy-core.c)"

when the speed and duplex settings are printed.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy_device.c