net: dsa: microchip: Move *_port_setup code to dsa_switch_ops::port_setup()
authorOleksij Rempel <o.rempel@pengutronix.de>
Thu, 14 Sep 2023 13:11:44 +0000 (15:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 17 Sep 2023 13:28:34 +0000 (14:28 +0100)
Right now, the *_port_setup code is in dsa_switch_ops::port_enable(),
which is not the best place for it. This patch moves it to a more
suitable place, dsa_switch_ops::port_setup(), to match the function's
purpose and name.

This patch is a preparation for coming ACL support patch.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/microchip/ksz_common.c

index 54048b82db71988587ac6a3bb366c29d27b5e484..209a5243bd5a0124d1b311d1683a2c440caf09ea 100644 (file)
@@ -2564,8 +2564,7 @@ static int ksz_port_mdb_del(struct dsa_switch *ds, int port,
        return dev->dev_ops->mdb_del(dev, port, mdb, db);
 }
 
-static int ksz_enable_port(struct dsa_switch *ds, int port,
-                          struct phy_device *phy)
+static int ksz_port_setup(struct dsa_switch *ds, int port)
 {
        struct ksz_device *dev = ds->priv;
 
@@ -3497,7 +3496,7 @@ static const struct dsa_switch_ops ksz_switch_ops = {
        .phylink_mac_config     = ksz_phylink_mac_config,
        .phylink_mac_link_up    = ksz_phylink_mac_link_up,
        .phylink_mac_link_down  = ksz_mac_link_down,
-       .port_enable            = ksz_enable_port,
+       .port_setup             = ksz_port_setup,
        .set_ageing_time        = ksz_set_ageing_time,
        .get_strings            = ksz_get_strings,
        .get_ethtool_stats      = ksz_get_ethtool_stats,