]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: dpaa2-mac: use .mac_select_pcs() interface
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Tue, 25 Jan 2022 16:27:30 +0000 (16:27 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 26 Jan 2022 16:35:34 +0000 (16:35 +0000)
Convert dpaa2-mac to use the mac_select_pcs() interface rather than
using phylink_set_pcs(). The intention here is to unify the approach
for PCS and eventually to remove phylink_set_pcs().

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c

index 623d113b6581dadf91352532940a62262c73e1ed..521f036d1c00367d8bf270749df8e4058e5cf5eb 100644 (file)
@@ -100,6 +100,14 @@ static int dpaa2_mac_get_if_mode(struct fwnode_handle *dpmac_node,
        return err;
 }
 
+static struct phylink_pcs *dpaa2_mac_select_pcs(struct phylink_config *config,
+                                               phy_interface_t interface)
+{
+       struct dpaa2_mac *mac = phylink_to_dpaa2_mac(config);
+
+       return mac->pcs;
+}
+
 static void dpaa2_mac_config(struct phylink_config *config, unsigned int mode,
                             const struct phylink_link_state *state)
 {
@@ -172,6 +180,7 @@ static void dpaa2_mac_link_down(struct phylink_config *config,
 
 static const struct phylink_mac_ops dpaa2_mac_phylink_ops = {
        .validate = phylink_generic_validate,
+       .mac_select_pcs = dpaa2_mac_select_pcs,
        .mac_config = dpaa2_mac_config,
        .mac_link_up = dpaa2_mac_link_up,
        .mac_link_down = dpaa2_mac_link_down,
@@ -303,9 +312,6 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac)
        }
        mac->phylink = phylink;
 
-       if (mac->pcs)
-               phylink_set_pcs(mac->phylink, mac->pcs);
-
        err = phylink_fwnode_phy_connect(mac->phylink, dpmac_node, 0);
        if (err) {
                netdev_err(net_dev, "phylink_fwnode_phy_connect() = %d\n", err);