Skip to content

Commit

Permalink
netdevsim: add stub netdevsim driver implementation
Browse files Browse the repository at this point in the history
In order to bus probing to work correctly, register a simple  netdevsim
driver implementation.

Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Apr 26, 2019
1 parent 40e4fe4 commit 23d415d
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion drivers/net/netdevsim/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,31 @@ void nsim_bus_dev_del(struct nsim_bus_dev *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)
{
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)
{
driver_unregister(&nsim_driver);
bus_unregister(&nsim_bus);
}

0 comments on commit 23d415d

Please sign in to comment.