The unapply functions are called on the error path.
As for dsa_port_mask, enabled_port_mask and cpu_port_mask won't be used
after so there's no need to unmask the corresponding port bit from them.
This makes dsa_cpu_port_unapply() and dsa_dsa_port_unapply() identical,
which can be factorized later.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
{
devlink_port_unregister(&port->devlink_port);
dsa_cpu_dsa_destroy(port);
- port->ds->cpu_port_mask &= ~BIT(port->index);
-
}
static int dsa_user_port_apply(struct dsa_port *port)
if (port->slave) {
dsa_slave_destroy(port->slave);
port->slave = NULL;
- port->ds->enabled_port_mask &= ~(1 << port->index);
}
}
tag_ops = dsa_resolve_tag_protocol(tag_protocol);
if (IS_ERR(tag_ops)) {
dev_warn(ds->dev, "No tagger for this switch\n");
- ds->cpu_port_mask &= ~BIT(index);
return PTR_ERR(tag_ops);
}