Skip to content

Commit

Permalink
mlx4: Rename member mlx4_en_dev.nb to netdev_nb
Browse files Browse the repository at this point in the history
Rename the mlx4_en_dev.nb notifier_block member to netdev_nb in
preparation to add a mlx4 core notifier_block.

Signed-off-by: Petr Pavlu <[email protected]>
Tested-by: Leon Romanovsky <[email protected]>
Reviewed-by: Leon Romanovsky <[email protected]>
Acked-by: Tariq Toukan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
petrpavlu authored and davem330 committed Aug 23, 2023
1 parent 71ab55a commit ef5617e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions drivers/net/ethernet/mellanox/mlx4/en_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ static void mlx4_en_remove(struct mlx4_dev *dev, void *endev_ptr)
iounmap(mdev->uar_map);
mlx4_uar_free(dev, &mdev->priv_uar);
mlx4_pd_free(dev, mdev->priv_pdn);
if (mdev->nb.notifier_call)
unregister_netdevice_notifier(&mdev->nb);
if (mdev->netdev_nb.notifier_call)
unregister_netdevice_notifier(&mdev->netdev_nb);
kfree(mdev);
}

Expand All @@ -252,11 +252,11 @@ static void mlx4_en_activate(struct mlx4_dev *dev, void *ctx)
mdev->pndev[i] = NULL;
}

/* register notifier */
mdev->nb.notifier_call = mlx4_en_netdev_event;
if (register_netdevice_notifier(&mdev->nb)) {
mdev->nb.notifier_call = NULL;
mlx4_err(mdev, "Failed to create notifier\n");
/* register netdev notifier */
mdev->netdev_nb.notifier_call = mlx4_en_netdev_event;
if (register_netdevice_notifier(&mdev->netdev_nb)) {
mdev->netdev_nb.notifier_call = NULL;
mlx4_err(mdev, "Failed to create netdev notifier\n");
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx4/en_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,7 @@ int mlx4_en_netdev_event(struct notifier_block *this,
if (!net_eq(dev_net(ndev), &init_net))
return NOTIFY_DONE;

mdev = container_of(this, struct mlx4_en_dev, nb);
mdev = container_of(this, struct mlx4_en_dev, netdev_nb);
dev = mdev->dev;

/* Go into this mode only when two network devices set on two ports
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx4/mlx4_en.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ struct mlx4_en_dev {
unsigned long last_overflow_check;
struct ptp_clock *ptp_clock;
struct ptp_clock_info ptp_clock_info;
struct notifier_block nb;
struct notifier_block netdev_nb;
};


Expand Down

0 comments on commit ef5617e

Please sign in to comment.