Move marking the PHY as being on a SFP module into the SFP code between
getting the PHY device (and thus initialising the phy_device structure)
and registering the discovered device.
This means that PHY drivers can use phy_on_sfp() in their match and
get_features methods.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/E1qRaga-001vKt-8X@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (phydev->sfp_bus_attached)
dev->sfp_bus = phydev->sfp_bus;
- else if (dev->sfp_bus)
- phydev->is_on_sfp_module = true;
}
/* Some Ethernet drivers try to connect to a PHY device before
return PTR_ERR(phy);
}
+ /* Mark this PHY as being on a SFP module */
+ phy->is_on_sfp_module = true;
+
err = phy_device_register(phy);
if (err) {
phy_device_free(phy);