]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: switchdev: delete switchdev_port_obj_add_now
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sat, 9 Jan 2021 00:01:49 +0000 (02:01 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 Jan 2021 00:00:56 +0000 (16:00 -0800)
After the removal of the transactional model inside
switchdev_port_obj_add_now, it has no added value and we can just call
switchdev_port_obj_notify directly, bypassing this function. Let's
delete it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jiri Pirko <jiri@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/switchdev/switchdev.c

index a575bb33ee6cd2d28e3c1b781ec2fa759a350070..3509d362056d3abd9f3ae4ec3c15203b91369a2e 100644 (file)
@@ -242,23 +242,15 @@ static int switchdev_port_obj_notify(enum switchdev_notifier_type nt,
        return 0;
 }
 
-static int switchdev_port_obj_add_now(struct net_device *dev,
-                                     const struct switchdev_obj *obj,
-                                     struct netlink_ext_ack *extack)
-{
-       ASSERT_RTNL();
-
-       return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD,
-                                        dev, obj, extack);
-}
-
 static void switchdev_port_obj_add_deferred(struct net_device *dev,
                                            const void *data)
 {
        const struct switchdev_obj *obj = data;
        int err;
 
-       err = switchdev_port_obj_add_now(dev, obj, NULL);
+       ASSERT_RTNL();
+       err = switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD,
+                                       dev, obj, NULL);
        if (err && err != -EOPNOTSUPP)
                netdev_err(dev, "failed (err=%d) to add object (id=%d)\n",
                           err, obj->id);
@@ -290,7 +282,8 @@ int switchdev_port_obj_add(struct net_device *dev,
        if (obj->flags & SWITCHDEV_F_DEFER)
                return switchdev_port_obj_add_defer(dev, obj);
        ASSERT_RTNL();
-       return switchdev_port_obj_add_now(dev, obj, extack);
+       return switchdev_port_obj_notify(SWITCHDEV_PORT_OBJ_ADD,
+                                        dev, obj, extack);
 }
 EXPORT_SYMBOL_GPL(switchdev_port_obj_add);