diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-25 16:59:49 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 08:52:02 +0300 |
commit | a60f9e48b7707b70a0701dd841e43492e1e68371 (patch) | |
tree | 7118ee84a693fcd6aeb52a0a7cc8f04afc955d23 /drivers/net/netdevsim/netdev.c | |
parent | f9d9db47d3ba87309e022efa33b438e5ef329411 (diff) | |
download | linux-a60f9e48b7707b70a0701dd841e43492e1e68371.tar.xz |
netdevsim: rename dev_init/exit() functions and make them independent on ns
These functions are going to be called from bus probe/release(),
therefore make them independent on ns struct and rename accordingly.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/netdev.c')
-rw-r--r-- | drivers/net/netdevsim/netdev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c index 37a442ffcb8b..28231bfbc989 100644 --- a/drivers/net/netdevsim/netdev.c +++ b/drivers/net/netdevsim/netdev.c @@ -77,7 +77,7 @@ static void nsim_free(struct net_device *dev) { struct netdevsim *ns = netdev_priv(dev); - nsim_dev_exit(ns); + nsim_dev_destroy(ns->nsim_dev); nsim_bus_dev_del(ns->nsim_bus_dev); /* netdev and vf state will be freed out of device_release() */ nsim_sdev_put(ns->sdev); @@ -395,17 +395,19 @@ static int nsim_newlink(struct net *src_net, struct net_device *dev, SET_NETDEV_DEV(dev, &ns->nsim_bus_dev->dev); ns->netdev = dev; - err = nsim_dev_init(ns); - if (err) + ns->nsim_dev = nsim_dev_create_with_ns(ns->nsim_bus_dev, ns); + if (IS_ERR(ns->nsim_dev)) { + err = PTR_ERR(ns->nsim_dev); goto err_dev_del; + } err = register_netdevice(dev); if (err) - goto err_dev_exit; + goto err_dev_destroy; return 0; -err_dev_exit: - nsim_dev_exit(ns); +err_dev_destroy: + nsim_dev_destroy(ns->nsim_dev); err_dev_del: nsim_bus_dev_del(ns->nsim_bus_dev); err_sdev_put: |