netdevsim: move device registration and related code to bus.c

Move netdevsim device registration into bus.c and alongside with that
the related sysfs attributes. Introduce new struct nsim_bus_dev to
represent a netdevsim device on netdevsim bus.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Jiri Pirko
2019-04-25 15:59:45 +02:00
committed by David S. Miller
parent 925f5afedb
commit 40e4fe4ce1
4 changed files with 207 additions and 163 deletions
+1 -1
View File
@@ -199,7 +199,7 @@ static int __nsim_dev_init(struct netdevsim *ns)
if (err)
goto err_fib_destroy;
err = devlink_register(devlink, &ns->dev);
err = devlink_register(devlink, &ns->nsim_bus_dev->dev);
if (err)
goto err_resources_unregister;