bus/vdev: use standard bus registration
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
This commit is contained in:
parent
577329e66b
commit
fea892e35f
@ -52,14 +52,10 @@ static struct vdev_device_list vdev_device_list =
|
||||
struct vdev_driver_list vdev_driver_list =
|
||||
TAILQ_HEAD_INITIALIZER(vdev_driver_list);
|
||||
|
||||
static void rte_vdev_bus_register(void);
|
||||
|
||||
/* register a driver */
|
||||
void
|
||||
rte_vdev_register(struct rte_vdev_driver *driver)
|
||||
{
|
||||
rte_vdev_bus_register();
|
||||
|
||||
TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next);
|
||||
}
|
||||
|
||||
@ -343,16 +339,4 @@ static struct rte_bus rte_vdev_bus = {
|
||||
.probe = vdev_probe,
|
||||
};
|
||||
|
||||
RTE_INIT(rte_vdev_bus_register);
|
||||
|
||||
static void rte_vdev_bus_register(void)
|
||||
{
|
||||
static int registered;
|
||||
|
||||
if (registered)
|
||||
return;
|
||||
|
||||
registered = 1;
|
||||
rte_vdev_bus.name = RTE_STR(virtual);
|
||||
rte_bus_register(&rte_vdev_bus);
|
||||
}
|
||||
RTE_REGISTER_BUS(VIRTUAL_BUS_NAME, rte_vdev_bus);
|
||||
|
@ -41,6 +41,8 @@ extern "C" {
|
||||
#include <rte_dev.h>
|
||||
#include <rte_devargs.h>
|
||||
|
||||
#define VIRTUAL_BUS_NAME "virtual"
|
||||
|
||||
struct rte_vdev_device {
|
||||
TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */
|
||||
struct rte_device device; /**< Inherit core device */
|
||||
|
Loading…
x
Reference in New Issue
Block a user