net: ocelot: Simplify MRP deletion
authorHoratiu Vultur <horatiu.vultur@microchip.com>
Tue, 23 Mar 2021 08:33:47 +0000 (09:33 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 Mar 2021 19:14:08 +0000 (12:14 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_mrp.c

index c3cbcaf64bb2d05a4479bd2eca52a2dae17ec9f2..08b481a934600350617390534bbb318566fa8442 100644 (file)
@@ -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);