Skip to content

Commit 0ec5ed6

Browse files
minimaxwelldavem330
authored andcommitted
net: sfp: pass the phy_device when disconnecting an sfp module's PHY
Pass the phy_device as a parameter to the sfp upstream .disconnect_phy operation. This is preparatory work to help track phy devices across a net_device's link. Signed-off-by: Maxime Chevallier <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6916e46 commit 0ec5ed6

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

drivers/net/phy/phylink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3408,7 +3408,8 @@ static int phylink_sfp_connect_phy(void *upstream, struct phy_device *phy)
34083408
return ret;
34093409
}
34103410

3411-
static void phylink_sfp_disconnect_phy(void *upstream)
3411+
static void phylink_sfp_disconnect_phy(void *upstream,
3412+
struct phy_device *phydev)
34123413
{
34133414
phylink_disconnect_phy(upstream);
34143415
}

drivers/net/phy/sfp-bus.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ static void sfp_unregister_bus(struct sfp_bus *bus)
486486
bus->socket_ops->stop(bus->sfp);
487487
bus->socket_ops->detach(bus->sfp);
488488
if (bus->phydev && ops && ops->disconnect_phy)
489-
ops->disconnect_phy(bus->upstream);
489+
ops->disconnect_phy(bus->upstream, bus->phydev);
490490
}
491491
bus->registered = false;
492492
}
@@ -742,7 +742,7 @@ void sfp_remove_phy(struct sfp_bus *bus)
742742
const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus);
743743

744744
if (ops && ops->disconnect_phy)
745-
ops->disconnect_phy(bus->upstream);
745+
ops->disconnect_phy(bus->upstream, bus->phydev);
746746
bus->phydev = NULL;
747747
}
748748
EXPORT_SYMBOL_GPL(sfp_remove_phy);

include/linux/sfp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ struct sfp_upstream_ops {
544544
void (*link_down)(void *priv);
545545
void (*link_up)(void *priv);
546546
int (*connect_phy)(void *priv, struct phy_device *);
547-
void (*disconnect_phy)(void *priv);
547+
void (*disconnect_phy)(void *priv, struct phy_device *);
548548
};
549549

550550
#if IS_ENABLED(CONFIG_SFP)

0 commit comments

Comments
 (0)