Commit 7f6e7101 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

nes: remove usage of dev->master

Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1cdfd72f
...@@ -135,6 +135,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier, ...@@ -135,6 +135,7 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
struct net_device *event_netdev = ifa->ifa_dev->dev; struct net_device *event_netdev = ifa->ifa_dev->dev;
struct nes_device *nesdev; struct nes_device *nesdev;
struct net_device *netdev; struct net_device *netdev;
struct net_device *upper_dev;
struct nes_vnic *nesvnic; struct nes_vnic *nesvnic;
unsigned int is_bonded; unsigned int is_bonded;
...@@ -145,8 +146,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier, ...@@ -145,8 +146,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
nesdev, nesdev->netdev[0]->name); nesdev, nesdev->netdev[0]->name);
netdev = nesdev->netdev[0]; netdev = nesdev->netdev[0];
nesvnic = netdev_priv(netdev); nesvnic = netdev_priv(netdev);
upper_dev = netdev_master_upper_dev_get(netdev);
is_bonded = netif_is_bond_slave(netdev) && is_bonded = netif_is_bond_slave(netdev) &&
(netdev->master == event_netdev); (upper_dev == event_netdev);
if ((netdev == event_netdev) || is_bonded) { if ((netdev == event_netdev) || is_bonded) {
if (nesvnic->rdma_enabled == 0) { if (nesvnic->rdma_enabled == 0) {
nes_debug(NES_DBG_NETDEV, "Returning without processing event for %s since" nes_debug(NES_DBG_NETDEV, "Returning without processing event for %s since"
...@@ -179,9 +181,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier, ...@@ -179,9 +181,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
/* fall through */ /* fall through */
case NETDEV_CHANGEADDR: case NETDEV_CHANGEADDR:
/* Add the address to the IP table */ /* Add the address to the IP table */
if (netdev->master) if (upper_dev)
nesvnic->local_ipaddr = nesvnic->local_ipaddr =
((struct in_device *)netdev->master->ip_ptr)->ifa_list->ifa_address; ((struct in_device *)upper_dev->ip_ptr)->ifa_list->ifa_address;
else else
nesvnic->local_ipaddr = ifa->ifa_address; nesvnic->local_ipaddr = ifa->ifa_address;
......
...@@ -1340,7 +1340,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi ...@@ -1340,7 +1340,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
} }
if (netif_is_bond_slave(nesvnic->netdev)) if (netif_is_bond_slave(nesvnic->netdev))
netdev = nesvnic->netdev->master; netdev = netdev_master_upper_dev_get(nesvnic->netdev);
else else
netdev = nesvnic->netdev; netdev = nesvnic->netdev;
......
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