drivers: use PCI registration macro
[dpdk.git] / drivers / net / mlx4 / mlx4.c
index efe60cf..18da84a 100644 (file)
@@ -5544,7 +5544,7 @@ static struct eth_driver mlx4_driver;
  *   0 on success, negative errno value on failure.
  */
 static int
-mlx4_pci_devinit(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
+mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 {
        struct ibv_device **list;
        struct ibv_device *ibv_dev;
@@ -5913,7 +5913,7 @@ static struct eth_driver mlx4_driver = {
        .pci_drv = {
                .name = MLX4_DRIVER_NAME,
                .id_table = mlx4_pci_id_map,
-               .devinit = mlx4_pci_devinit,
+               .probe = mlx4_pci_probe,
                .drv_flags = RTE_PCI_DRV_INTR_LSC,
        },
        .dev_private_size = sizeof(struct priv)
@@ -5922,12 +5922,10 @@ static struct eth_driver mlx4_driver = {
 /**
  * Driver initialization routine.
  */
-static int
-rte_mlx4_pmd_init(const char *name, const char *args)
+RTE_INIT(rte_mlx4_pmd_init);
+static void
+rte_mlx4_pmd_init(void)
 {
-       (void)name;
-       (void)args;
-
        RTE_BUILD_BUG_ON(sizeof(wr_id_t) != sizeof(uint64_t));
        /*
         * RDMAV_HUGEPAGES_SAFE tells ibv_fork_init() we intend to use
@@ -5938,13 +5936,7 @@ rte_mlx4_pmd_init(const char *name, const char *args)
        setenv("RDMAV_HUGEPAGES_SAFE", "1", 1);
        ibv_fork_init();
        rte_eal_pci_register(&mlx4_driver.pci_drv);
-       return 0;
 }
 
-static struct rte_driver rte_mlx4_driver = {
-       .type = PMD_PDEV,
-       .init = rte_mlx4_pmd_init,
-};
-
-PMD_REGISTER_DRIVER(rte_mlx4_driver, net_mlx4);
+DRIVER_EXPORT_NAME(net_mlx4, __COUNTER__);
 DRIVER_REGISTER_PCI_TABLE(net_mlx4, mlx4_pci_id_map);