mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
net: dsa: microchip: implement port_teardown only if needed
The port_teardown() operation is optional. Yet, it is implemented by all the KSZ switches through a common function that doesn't do anything for the switches that aren't part of the ksz9477 family Remove the implementation from the switches that don't need it. Implement instead a ksz9477-specific port_teardown. Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@bootlin.com> Link: https://patch.msgid.link/20260608-clean-ksz-3rd-v2-10-6e61b7be23c4@bootlin.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
03d10c7768
commit
af472a40b2
|
|
@ -2539,7 +2539,6 @@ const struct dsa_switch_ops ksz8463_switch_ops = {
|
|||
.port_bridge_leave = ksz_port_bridge_leave,
|
||||
.port_set_mac_address = ksz_port_set_mac_address,
|
||||
.port_stp_state_set = ksz_port_stp_state_set,
|
||||
.port_teardown = ksz_port_teardown,
|
||||
.port_pre_bridge_flags = ksz_port_pre_bridge_flags,
|
||||
.port_bridge_flags = ksz_port_bridge_flags,
|
||||
.port_fast_age = ksz8_flush_dyn_mac_table,
|
||||
|
|
@ -2587,7 +2586,6 @@ const struct dsa_switch_ops ksz87xx_switch_ops = {
|
|||
.port_bridge_leave = ksz_port_bridge_leave,
|
||||
.port_set_mac_address = ksz_port_set_mac_address,
|
||||
.port_stp_state_set = ksz_port_stp_state_set,
|
||||
.port_teardown = ksz_port_teardown,
|
||||
.port_pre_bridge_flags = ksz_port_pre_bridge_flags,
|
||||
.port_bridge_flags = ksz_port_bridge_flags,
|
||||
.port_fast_age = ksz8_flush_dyn_mac_table,
|
||||
|
|
@ -2639,7 +2637,6 @@ const struct dsa_switch_ops ksz88xx_switch_ops = {
|
|||
.port_bridge_leave = ksz_port_bridge_leave,
|
||||
.port_set_mac_address = ksz_port_set_mac_address,
|
||||
.port_stp_state_set = ksz_port_stp_state_set,
|
||||
.port_teardown = ksz_port_teardown,
|
||||
.port_pre_bridge_flags = ksz_port_pre_bridge_flags,
|
||||
.port_bridge_flags = ksz_port_bridge_flags,
|
||||
.port_fast_age = ksz8_flush_dyn_mac_table,
|
||||
|
|
|
|||
|
|
@ -1941,6 +1941,14 @@ static void ksz9477_duplex_flowctrl(struct ksz_device *dev, int port, int duplex
|
|||
ksz_prmw8(dev, port, regs[P_XMII_CTRL_0], mask, val);
|
||||
}
|
||||
|
||||
static void ksz9477_port_teardown(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
|
||||
if (dsa_is_user_port(ds, port))
|
||||
ksz9477_port_acl_free(dev, port);
|
||||
}
|
||||
|
||||
void ksz9477_phylink_mac_link_up(struct phylink_config *config,
|
||||
struct phy_device *phydev,
|
||||
unsigned int mode,
|
||||
|
|
@ -2073,7 +2081,7 @@ const struct dsa_switch_ops ksz9477_switch_ops = {
|
|||
.port_hsr_leave = ksz9477_hsr_leave,
|
||||
.port_set_mac_address = ksz_port_set_mac_address,
|
||||
.port_stp_state_set = ksz_port_stp_state_set,
|
||||
.port_teardown = ksz_port_teardown,
|
||||
.port_teardown = ksz9477_port_teardown,
|
||||
.port_pre_bridge_flags = ksz_port_pre_bridge_flags,
|
||||
.port_bridge_flags = ksz_port_bridge_flags,
|
||||
.port_fast_age = ksz9477_flush_dyn_mac_table,
|
||||
|
|
|
|||
|
|
@ -2953,25 +2953,6 @@ void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state)
|
|||
ksz_update_port_member(dev, port);
|
||||
}
|
||||
|
||||
void ksz_port_teardown(struct dsa_switch *ds, int port)
|
||||
{
|
||||
struct ksz_device *dev = ds->priv;
|
||||
|
||||
switch (dev->chip_id) {
|
||||
case KSZ8563_CHIP_ID:
|
||||
case KSZ8567_CHIP_ID:
|
||||
case KSZ9477_CHIP_ID:
|
||||
case KSZ9563_CHIP_ID:
|
||||
case KSZ9567_CHIP_ID:
|
||||
case KSZ9893_CHIP_ID:
|
||||
case KSZ9896_CHIP_ID:
|
||||
case KSZ9897_CHIP_ID:
|
||||
case LAN9646_CHIP_ID:
|
||||
if (dsa_is_user_port(ds, port))
|
||||
ksz9477_port_acl_free(dev, port);
|
||||
}
|
||||
}
|
||||
|
||||
int ksz_port_pre_bridge_flags(struct dsa_switch *ds, int port,
|
||||
struct switchdev_brport_flags flags,
|
||||
struct netlink_ext_ack *extack)
|
||||
|
|
|
|||
|
|
@ -391,7 +391,6 @@ int ksz_switch_suspend(struct device *dev);
|
|||
int ksz_switch_resume(struct device *dev);
|
||||
|
||||
void ksz_teardown(struct dsa_switch *ds);
|
||||
void ksz_port_teardown(struct dsa_switch *ds, int port);
|
||||
|
||||
void ksz_init_mib_timer(struct ksz_device *dev);
|
||||
bool ksz_is_port_mac_global_usable(struct dsa_switch *ds, int port);
|
||||
|
|
|
|||
|
|
@ -967,7 +967,6 @@ const struct dsa_switch_ops lan937x_switch_ops = {
|
|||
.port_bridge_leave = ksz_port_bridge_leave,
|
||||
.port_set_mac_address = ksz_port_set_mac_address,
|
||||
.port_stp_state_set = ksz_port_stp_state_set,
|
||||
.port_teardown = ksz_port_teardown,
|
||||
.port_pre_bridge_flags = ksz_port_pre_bridge_flags,
|
||||
.port_bridge_flags = ksz_port_bridge_flags,
|
||||
.port_fast_age = ksz9477_flush_dyn_mac_table,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user