As a part of working on MII time stamping infrastructure, I was trying
to figure out how netdev->phydev gets assigned, and I stumbled across
this. Ever since the new phylink code came in, the field is assigned
twice.
The function, phylink_connect_phy(), calls
phy_attach_direct()
phylink_bringup_phy()
and phy_attach_direct() sets
dev->phydev = phydev;
but phylink_bringup_phy() then sets the same field again:
pl->netdev->phydev = phy;
Similarly, the function, phylink_of_phy_connect(), calls