Skip to content

Commit a5d66f8

Browse files
Russell KingJakub Kicinski
authored andcommitted
net: phy: initialise phydev speed and duplex sanely
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 <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent e3cf8b3 commit a5d66f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/phy/phy_device.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,8 +597,8 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id,
597597
mdiodev->device_free = phy_mdio_device_free;
598598
mdiodev->device_remove = phy_mdio_device_remove;
599599

600-
dev->speed = 0;
601-
dev->duplex = -1;
600+
dev->speed = SPEED_UNKNOWN;
601+
dev->duplex = DUPLEX_UNKNOWN;
602602
dev->pause = 0;
603603
dev->asym_pause = 0;
604604
dev->link = 0;

0 commit comments

Comments
 (0)