Skip to content

Commit

Permalink
net: lan966x: use .mac_select_pcs() interface
Browse files Browse the repository at this point in the history
Convert lan966x to use the mac_select_interface instead of
phylink_set_pcs.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://lore.kernel.org/r/20220202114949.833075-1-horatiu.vultur@microchip.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Horatiu Vultur authored and Jakub Kicinski committed Feb 4, 2022
1 parent 95eb6ef commit 41414c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/net/ethernet/microchip/lan966x/lan966x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,6 @@ static int lan966x_probe_port(struct lan966x *lan966x, u32 p,
}

port->phylink = phylink;
phylink_set_pcs(phylink, &port->phylink_pcs);

err = register_netdev(dev);
if (err) {
Expand Down
9 changes: 9 additions & 0 deletions drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@

#include "lan966x_main.h"

static struct phylink_pcs *lan966x_phylink_mac_select(struct phylink_config *config,
phy_interface_t interface)
{
struct lan966x_port *port = netdev_priv(to_net_dev(config->dev));

return &port->phylink_pcs;
}

static void lan966x_phylink_mac_config(struct phylink_config *config,
unsigned int mode,
const struct phylink_link_state *state)
Expand Down Expand Up @@ -114,6 +122,7 @@ static void lan966x_pcs_aneg_restart(struct phylink_pcs *pcs)

const struct phylink_mac_ops lan966x_phylink_mac_ops = {
.validate = phylink_generic_validate,
.mac_select_pcs = lan966x_phylink_mac_select,
.mac_config = lan966x_phylink_mac_config,
.mac_prepare = lan966x_phylink_mac_prepare,
.mac_link_down = lan966x_phylink_mac_link_down,
Expand Down

0 comments on commit 41414c9

Please sign in to comment.