Commit 6dffb044 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

net: propagate upper priv via netdev_master_upper_dev_link

Eliminate netdev_master_upper_dev_link_private and pass priv directly as
a parameter of netdev_master_upper_dev_link.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0ba1414
...@@ -1204,7 +1204,7 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev, ...@@ -1204,7 +1204,7 @@ static int bond_master_upper_dev_link(struct net_device *bond_dev,
{ {
int err; int err;
err = netdev_master_upper_dev_link_private(slave_dev, bond_dev, slave); err = netdev_master_upper_dev_link(slave_dev, bond_dev, slave);
if (err) if (err)
return err; return err;
slave_dev->flags |= IFF_SLAVE; slave_dev->flags |= IFF_SLAVE;
......
...@@ -1083,7 +1083,7 @@ static int team_upper_dev_link(struct net_device *dev, ...@@ -1083,7 +1083,7 @@ static int team_upper_dev_link(struct net_device *dev,
{ {
int err; int err;
err = netdev_master_upper_dev_link(port_dev, dev); err = netdev_master_upper_dev_link(port_dev, dev, NULL);
if (err) if (err)
return err; return err;
port_dev->priv_flags |= IFF_TEAM_PORT; port_dev->priv_flags |= IFF_TEAM_PORT;
......
...@@ -624,7 +624,7 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev) ...@@ -624,7 +624,7 @@ static int do_vrf_add_slave(struct net_device *dev, struct net_device *port_dev)
goto out_fail; goto out_fail;
} }
ret = netdev_master_upper_dev_link(port_dev, dev); ret = netdev_master_upper_dev_link(port_dev, dev, NULL);
if (ret < 0) if (ret < 0)
goto out_unregister; goto out_unregister;
......
...@@ -3619,10 +3619,8 @@ struct net_device *netdev_master_upper_dev_get(struct net_device *dev); ...@@ -3619,10 +3619,8 @@ struct net_device *netdev_master_upper_dev_get(struct net_device *dev);
struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev); struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev);
int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev); int netdev_upper_dev_link(struct net_device *dev, struct net_device *upper_dev);
int netdev_master_upper_dev_link(struct net_device *dev, int netdev_master_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev); struct net_device *upper_dev,
int netdev_master_upper_dev_link_private(struct net_device *dev, void *upper_priv);
struct net_device *upper_dev,
void *private);
void netdev_upper_dev_unlink(struct net_device *dev, void netdev_upper_dev_unlink(struct net_device *dev,
struct net_device *upper_dev); struct net_device *upper_dev);
void netdev_adjacent_rename_links(struct net_device *dev, char *oldname); void netdev_adjacent_rename_links(struct net_device *dev, char *oldname);
......
...@@ -464,7 +464,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, ...@@ -464,7 +464,8 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface,
hard_iface->soft_iface = soft_iface; hard_iface->soft_iface = soft_iface;
bat_priv = netdev_priv(hard_iface->soft_iface); bat_priv = netdev_priv(hard_iface->soft_iface);
ret = netdev_master_upper_dev_link(hard_iface->net_dev, soft_iface); ret = netdev_master_upper_dev_link(hard_iface->net_dev,
soft_iface, NULL);
if (ret) if (ret)
goto err_dev; goto err_dev;
......
...@@ -493,7 +493,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) ...@@ -493,7 +493,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
dev->priv_flags |= IFF_BRIDGE_PORT; dev->priv_flags |= IFF_BRIDGE_PORT;
err = netdev_master_upper_dev_link(dev, br->dev); err = netdev_master_upper_dev_link(dev, br->dev, NULL);
if (err) if (err)
goto err5; goto err5;
......
...@@ -5421,7 +5421,7 @@ static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev, ...@@ -5421,7 +5421,7 @@ static void __netdev_adjacent_dev_unlink_neighbour(struct net_device *dev,
static int __netdev_upper_dev_link(struct net_device *dev, static int __netdev_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev, bool master, struct net_device *upper_dev, bool master,
void *private) void *upper_priv)
{ {
struct netdev_notifier_changeupper_info changeupper_info; struct netdev_notifier_changeupper_info changeupper_info;
struct netdev_adjacent *i, *j, *to_i, *to_j; struct netdev_adjacent *i, *j, *to_i, *to_j;
...@@ -5452,7 +5452,7 @@ static int __netdev_upper_dev_link(struct net_device *dev, ...@@ -5452,7 +5452,7 @@ static int __netdev_upper_dev_link(struct net_device *dev,
if (ret) if (ret)
return ret; return ret;
ret = __netdev_adjacent_dev_link_neighbour(dev, upper_dev, private, ret = __netdev_adjacent_dev_link_neighbour(dev, upper_dev, upper_priv,
master); master);
if (ret) if (ret)
return ret; return ret;
...@@ -5557,6 +5557,7 @@ EXPORT_SYMBOL(netdev_upper_dev_link); ...@@ -5557,6 +5557,7 @@ EXPORT_SYMBOL(netdev_upper_dev_link);
* netdev_master_upper_dev_link - Add a master link to the upper device * netdev_master_upper_dev_link - Add a master link to the upper device
* @dev: device * @dev: device
* @upper_dev: new upper device * @upper_dev: new upper device
* @upper_priv: upper device private
* *
* Adds a link to device which is upper to this one. In this case, only * Adds a link to device which is upper to this one. In this case, only
* one master upper device can be linked, although other non-master devices * one master upper device can be linked, although other non-master devices
...@@ -5565,20 +5566,13 @@ EXPORT_SYMBOL(netdev_upper_dev_link); ...@@ -5565,20 +5566,13 @@ EXPORT_SYMBOL(netdev_upper_dev_link);
* counts are adjusted and the function returns zero. * counts are adjusted and the function returns zero.
*/ */
int netdev_master_upper_dev_link(struct net_device *dev, int netdev_master_upper_dev_link(struct net_device *dev,
struct net_device *upper_dev) struct net_device *upper_dev,
void *upper_priv)
{ {
return __netdev_upper_dev_link(dev, upper_dev, true, NULL); return __netdev_upper_dev_link(dev, upper_dev, true, upper_priv);
} }
EXPORT_SYMBOL(netdev_master_upper_dev_link); EXPORT_SYMBOL(netdev_master_upper_dev_link);
int netdev_master_upper_dev_link_private(struct net_device *dev,
struct net_device *upper_dev,
void *private)
{
return __netdev_upper_dev_link(dev, upper_dev, true, private);
}
EXPORT_SYMBOL(netdev_master_upper_dev_link_private);
/** /**
* netdev_upper_dev_unlink - Removes a link to upper device * netdev_upper_dev_unlink - Removes a link to upper device
* @dev: device * @dev: device
......
...@@ -105,7 +105,7 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name) ...@@ -105,7 +105,7 @@ struct vport *ovs_netdev_link(struct vport *vport, const char *name)
rtnl_lock(); rtnl_lock();
err = netdev_master_upper_dev_link(vport->dev, err = netdev_master_upper_dev_link(vport->dev,
get_dpdev(vport->dp)); get_dpdev(vport->dp), NULL);
if (err) if (err)
goto error_unlock; goto error_unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment