diff options
author | Jiri Pirko <jiri@mellanox.com> | 2019-04-25 15:59:44 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-26 01:52:02 -0400 |
commit | 925f5afedb93f7c80958c6bf7ce6cc31542076dc (patch) | |
tree | ea5aa25c130f56d87bcccba92f8bfe0d43fe58b3 /drivers/net/netdevsim/bus.c | |
parent | netdevsim: rename devlink.c to dev.c to contain per-dev(asic) items (diff) | |
download | linux-dev-925f5afedb93f7c80958c6bf7ce6cc31542076dc.tar.xz linux-dev-925f5afedb93f7c80958c6bf7ce6cc31542076dc.zip |
netdevsim: put netdevsim bus code into separate file
As the code related to netdevsim bus is going to get bigger, move the
existing code to a separate file.
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim/bus.c')
-rw-r--r-- | drivers/net/netdevsim/bus.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/net/netdevsim/bus.c b/drivers/net/netdevsim/bus.c new file mode 100644 index 000000000000..26b866b72afc --- /dev/null +++ b/drivers/net/netdevsim/bus.c @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: GPL-2.0 +/* Copyright (C) 2017 Netronome Systems, Inc. + * Copyright (C) 2019 Mellanox Technologies. All rights reserved + */ + +#include <linux/device.h> + +#include "netdevsim.h" + +struct bus_type nsim_bus = { + .name = DRV_NAME, + .dev_name = DRV_NAME, + .num_vf = nsim_num_vf, +}; + +int nsim_bus_init(void) +{ + return bus_register(&nsim_bus); +} + +void nsim_bus_exit(void) +{ + bus_unregister(&nsim_bus); +} |