[net-next,1/2] net: dsa: microchip: Move *_port_setup code to dsa_switch_ops::port_setup()

Message ID 20230914131145.23336-1-o.rempel@pengutronix.de
State New
Headers
Series [net-next,1/2] net: dsa: microchip: Move *_port_setup code to dsa_switch_ops::port_setup() |

Commit Message

Oleksij Rempel Sept. 14, 2023, 1:11 p.m. UTC
  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>
---
 drivers/net/dsa/microchip/ksz_common.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Vladimir Oltean Sept. 15, 2023, 2:35 p.m. UTC | #1
On Thu, Sep 14, 2023 at 03:11:44PM +0200, Oleksij Rempel wrote:
> 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>
  
Florian Fainelli Sept. 15, 2023, 4:37 p.m. UTC | #2
On 9/14/23 06:11, Oleksij Rempel wrote:
> 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: Florian Fainelli <florian.fainelli@broadcom.com>
  
patchwork-bot+netdevbpf@kernel.org Sept. 17, 2023, 1:30 p.m. UTC | #3
Hello:

This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 14 Sep 2023 15:11:44 +0200 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: dsa: microchip: Move *_port_setup code to dsa_switch_ops::port_setup()
    https://git.kernel.org/netdev/net-next/c/152992279e41
  - [net-next,2/2] net: dsa: microchip: Add partial ACL support for ksz9477 switches
    https://git.kernel.org/netdev/net-next/c/002841be134e

You are awesome, thank you!
  

Patch

diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index 54048b82db71..209a5243bd5a 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -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,