Message ID | 20210323083347.1474883-3-horatiu.vultur@microchip.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 5b7c0c32c90494f5aaf13f417cff5dc204575597 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | bridge: mrp: Disable roles before deleting | expand |
Context | Check | Description |
---|---|---|
netdev/cover_letter | success | Link |
netdev/fixes_present | success | Link |
netdev/patch_count | success | Link |
netdev/tree_selection | success | Clearly marked for net-next |
netdev/subject_prefix | success | Link |
netdev/cc_maintainers | success | CCed 7 of 7 maintainers |
netdev/source_inline | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Link |
netdev/module_param | success | Was 0 now: 0 |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/verify_fixes | success | Link |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 30 lines checked |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/header_inline | success | Link |
diff --git a/drivers/net/ethernet/mscc/ocelot_mrp.c b/drivers/net/ethernet/mscc/ocelot_mrp.c index c3cbcaf64bb2..08b481a93460 100644 --- a/drivers/net/ethernet/mscc/ocelot_mrp.c +++ b/drivers/net/ethernet/mscc/ocelot_mrp.c @@ -154,7 +154,6 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port, const struct switchdev_obj_mrp *mrp) { struct ocelot_port *ocelot_port = ocelot->ports[port]; - int i; if (!ocelot_port) return -EOPNOTSUPP; @@ -162,23 +161,8 @@ int ocelot_mrp_del(struct ocelot *ocelot, int port, if (ocelot_port->mrp_ring_id != mrp->ring_id) return 0; - ocelot_mrp_del_vcap(ocelot, port); - ocelot_mrp_del_vcap(ocelot, port + ocelot->num_phys_ports); - ocelot_port->mrp_ring_id = 0; - for (i = 0; i < ocelot->num_phys_ports; ++i) { - ocelot_port = ocelot->ports[i]; - - if (!ocelot_port) - continue; - - if (ocelot_port->mrp_ring_id != 0) - goto out; - } - - ocelot_mrp_del_mac(ocelot, ocelot->ports[port]); -out: return 0; } EXPORT_SYMBOL(ocelot_mrp_del);
Now that the driver will always be notified that the role is deleted before the ring is deleted, then we don't need to duplicate the logic of cleaning the resources also in the delete function. Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com> --- drivers/net/ethernet/mscc/ocelot_mrp.c | 16 ---------------- 1 file changed, 16 deletions(-)