Commit 23d415da authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

netdevsim: add stub netdevsim driver implementation

In order to bus probing to work correctly, register a simple  netdevsim
driver implementation.
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40e4fe4c
...@@ -153,12 +153,31 @@ void nsim_bus_dev_del(struct nsim_bus_dev *nsim_bus_dev) ...@@ -153,12 +153,31 @@ void nsim_bus_dev_del(struct nsim_bus_dev *nsim_bus_dev)
kfree(nsim_bus_dev); kfree(nsim_bus_dev);
} }
static struct device_driver nsim_driver = {
.name = DRV_NAME,
.bus = &nsim_bus,
.owner = THIS_MODULE,
};
int nsim_bus_init(void) int nsim_bus_init(void)
{ {
return bus_register(&nsim_bus); int err;
err = bus_register(&nsim_bus);
if (err)
return err;
err = driver_register(&nsim_driver);
if (err)
goto err_bus_unregister;
return 0;
err_bus_unregister:
bus_unregister(&nsim_bus);
return err;
} }
void nsim_bus_exit(void) void nsim_bus_exit(void)
{ {
driver_unregister(&nsim_driver);
bus_unregister(&nsim_bus); bus_unregister(&nsim_bus);
} }
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