net: switchdev: delete switchdev_port_obj_add_now
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>
This commit is contained in:
parent
ffb68fc58e
commit
cf6def51ba
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user