Skip to content

Commit 9b8d70e

Browse files
Danielmachonkuba-moo
authored andcommitted
net: sparx5: only return PCS for modes that require it
The RGMII ports have no PCS to configure. Make sure we only return the PCS for port modes that require it. Reviewed-by: Russell King (Oracle) <[email protected]> Tested-by: Robert Marko <[email protected]> Signed-off-by: Daniel Machon <[email protected]> Link: https://patch.msgid.link/20241220-sparx5-lan969x-switch-driver-4-v5-5-fa8ba5dff732@microchip.com Signed-off-by: Jakub Kicinski <[email protected]>
1 parent d945093 commit 9b8d70e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,19 @@ sparx5_phylink_mac_select_pcs(struct phylink_config *config,
3232
{
3333
struct sparx5_port *port = netdev_priv(to_net_dev(config->dev));
3434

35-
return &port->phylink_pcs;
35+
/* Return the PCS for all the modes that require it. */
36+
switch (interface) {
37+
case PHY_INTERFACE_MODE_SGMII:
38+
case PHY_INTERFACE_MODE_QSGMII:
39+
case PHY_INTERFACE_MODE_1000BASEX:
40+
case PHY_INTERFACE_MODE_2500BASEX:
41+
case PHY_INTERFACE_MODE_5GBASER:
42+
case PHY_INTERFACE_MODE_10GBASER:
43+
case PHY_INTERFACE_MODE_25GBASER:
44+
return &port->phylink_pcs;
45+
default:
46+
return NULL;
47+
}
3648
}
3749

3850
static void sparx5_phylink_mac_config(struct phylink_config *config,

0 commit comments

Comments
 (0)