mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
net: phylink: use sfp_get_module_caps()
Use sfp_get_module_caps() to get SFP module's capabilities. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Link: https://patch.msgid.link/E1uydVp-000000061WW-08YM@rmk-PC.armlinux.org.uk Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
64fb4a3ae8
commit
cab1165195
|
|
@ -3750,17 +3750,18 @@ static int phylink_sfp_config_optical(struct phylink *pl)
|
|||
static int phylink_sfp_module_insert(void *upstream,
|
||||
const struct sfp_eeprom_id *id)
|
||||
{
|
||||
const struct sfp_module_caps *caps;
|
||||
struct phylink *pl = upstream;
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
linkmode_zero(pl->sfp_support);
|
||||
phy_interface_zero(pl->sfp_interfaces);
|
||||
sfp_parse_support(pl->sfp_bus, id, pl->sfp_support, pl->sfp_interfaces);
|
||||
pl->sfp_port = sfp_parse_port(pl->sfp_bus, id, pl->sfp_support);
|
||||
caps = sfp_get_module_caps(pl->sfp_bus);
|
||||
phy_interface_copy(pl->sfp_interfaces, caps->interfaces);
|
||||
linkmode_copy(pl->sfp_support, caps->link_modes);
|
||||
pl->sfp_may_have_phy = caps->may_have_phy;
|
||||
pl->sfp_port = caps->port;
|
||||
|
||||
/* If this module may have a PHY connecting later, defer until later */
|
||||
pl->sfp_may_have_phy = sfp_may_have_phy(pl->sfp_bus, id);
|
||||
if (pl->sfp_may_have_phy)
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user