Skip to content

Commit b7bc2a5

Browse files
Amerigo Wangdavem330
authored andcommitted
net: remove netdev_bonding_change()
I don't see any benifits to use netdev_bonding_change() than using call_netdevice_notifiers() directly. Cc: David S. Miller <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ee89bab commit b7bc2a5

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,10 +1120,10 @@ void bond_change_active_slave(struct bonding *bond, struct slave *new_active)
11201120
write_unlock_bh(&bond->curr_slave_lock);
11211121
read_unlock(&bond->lock);
11221122

1123-
netdev_bonding_change(bond->dev, NETDEV_BONDING_FAILOVER);
1123+
call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, bond->dev);
11241124
if (should_notify_peers)
1125-
netdev_bonding_change(bond->dev,
1126-
NETDEV_NOTIFY_PEERS);
1125+
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS,
1126+
bond->dev);
11271127

11281128
read_lock(&bond->lock);
11291129
write_lock_bh(&bond->curr_slave_lock);
@@ -1560,8 +1560,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
15601560
bond_dev->name,
15611561
bond_dev->type, slave_dev->type);
15621562

1563-
res = netdev_bonding_change(bond_dev,
1564-
NETDEV_PRE_TYPE_CHANGE);
1563+
res = call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
1564+
bond_dev);
15651565
res = notifier_to_errno(res);
15661566
if (res) {
15671567
pr_err("%s: refused to change device type\n",
@@ -1581,8 +1581,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
15811581
bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
15821582
}
15831583

1584-
netdev_bonding_change(bond_dev,
1585-
NETDEV_POST_TYPE_CHANGE);
1584+
call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE,
1585+
bond_dev);
15861586
}
15871587
} else if (bond_dev->type != slave_dev->type) {
15881588
pr_err("%s ether type (%d) is different from other slaves (%d), can not enslave it.\n",
@@ -1943,7 +1943,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
19431943
}
19441944

19451945
block_netpoll_tx();
1946-
netdev_bonding_change(bond_dev, NETDEV_RELEASE);
1946+
call_netdevice_notifiers(NETDEV_RELEASE, bond_dev);
19471947
write_lock_bh(&bond->lock);
19481948

19491949
slave = bond_get_slave_by_dev(bond, slave_dev);
@@ -2586,7 +2586,7 @@ void bond_mii_monitor(struct work_struct *work)
25862586
read_unlock(&bond->lock);
25872587
return;
25882588
}
2589-
netdev_bonding_change(bond->dev, NETDEV_NOTIFY_PEERS);
2589+
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
25902590
rtnl_unlock();
25912591
}
25922592
}
@@ -3205,7 +3205,7 @@ void bond_activebackup_arp_mon(struct work_struct *work)
32053205
read_unlock(&bond->lock);
32063206
return;
32073207
}
3208-
netdev_bonding_change(bond->dev, NETDEV_NOTIFY_PEERS);
3208+
call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, bond->dev);
32093209
rtnl_unlock();
32103210
}
32113211
}

include/linux/netdevice.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,8 +2595,6 @@ extern int dev_set_promiscuity(struct net_device *dev, int inc);
25952595
extern int dev_set_allmulti(struct net_device *dev, int inc);
25962596
extern void netdev_state_change(struct net_device *dev);
25972597
extern void netdev_notify_peers(struct net_device *dev);
2598-
extern int netdev_bonding_change(struct net_device *dev,
2599-
unsigned long event);
26002598
extern void netdev_features_change(struct net_device *dev);
26012599
/* Load a device via the kmod */
26022600
extern void dev_load(struct net *net, const char *name);

net/core/dev.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,12 +1124,6 @@ void netdev_notify_peers(struct net_device *dev)
11241124
}
11251125
EXPORT_SYMBOL(netdev_notify_peers);
11261126

1127-
int netdev_bonding_change(struct net_device *dev, unsigned long event)
1128-
{
1129-
return call_netdevice_notifiers(event, dev);
1130-
}
1131-
EXPORT_SYMBOL(netdev_bonding_change);
1132-
11331127
/**
11341128
* dev_load - load a network module
11351129
* @net: the applicable net namespace

0 commit comments

Comments
 (0)