Skip to content

Commit

Permalink
net: phy: marvell-88x2222: set proper phydev->port
Browse files Browse the repository at this point in the history
phydev->port was not set and always reported as PORT_TP.
Set phydev->port according to inserted SFP module.

Signed-off-by: Ivan Bornyakov <i.bornyakov@metrotek.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ivan Bornyakov authored and David S. Miller committed Jun 15, 2022
1 parent 3a51e96 commit 9794ef5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/phy/marvell-88x2222.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ static int mv2222_sfp_insert(void *upstream, const struct sfp_eeprom_id *id)
dev = &phydev->mdio.dev;

sfp_parse_support(phydev->sfp_bus, id, sfp_supported);
phydev->port = sfp_parse_port(phydev->sfp_bus, id, sfp_supported);
sfp_interface = sfp_select_interface(phydev->sfp_bus, sfp_supported);

dev_info(dev, "%s SFP module inserted\n", phy_modes(sfp_interface));
Expand Down Expand Up @@ -526,6 +527,7 @@ static void mv2222_sfp_remove(void *upstream)

priv->line_interface = PHY_INTERFACE_MODE_NA;
linkmode_zero(priv->supported);
phydev->port = PORT_NONE;
}

static void mv2222_sfp_link_up(void *upstream)
Expand Down

0 comments on commit 9794ef5

Please sign in to comment.