aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorJiri Pirko2019-10-03 11:49:38 +0200
committerDavid S. Miller2019-10-04 11:10:56 -0700
commit4f174bbcc96c80720722e25f198580a184803c3a (patch)
tree0a40ee23dec7073d1914f0a3a9d2b4212f0f1887 /drivers/net/netdevsim
parent90d299138dd42579084715d6d25f9c27b63211af (diff)
netdevsim: take devlink net instead of init_net
Follow-up patch is going to allow to reload devlink instance into different network namespace, so use devlink_net() helper instead of init_net. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/fib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/netdevsim/fib.c b/drivers/net/netdevsim/fib.c
index fdc682f3a09a..13540dee7364 100644
--- a/drivers/net/netdevsim/fib.c
+++ b/drivers/net/netdevsim/fib.c
@@ -260,7 +260,7 @@ struct nsim_fib_data *nsim_fib_create(struct devlink *devlink,
nsim_fib_set_max_all(data, devlink);
data->fib_nb.notifier_call = nsim_fib_event_nb;
- err = register_fib_notifier(&init_net, &data->fib_nb,
+ err = register_fib_notifier(devlink_net(devlink), &data->fib_nb,
nsim_fib_dump_inconsistent, extack);
if (err) {
pr_err("Failed to register fib notifier\n");
@@ -300,6 +300,6 @@ void nsim_fib_destroy(struct devlink *devlink, struct nsim_fib_data *data)
NSIM_RESOURCE_IPV4_FIB_RULES);
devlink_resource_occ_get_unregister(devlink,
NSIM_RESOURCE_IPV4_FIB);
- unregister_fib_notifier(&init_net, &data->fib_nb);
+ unregister_fib_notifier(devlink_net(devlink), &data->fib_nb);
kfree(data);
}