Signed-off-by: Jan Blunck <jblu...@infradead.org>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 29 +++++++++++++++++++----------
 drivers/net/cxgbe/sge.c          |  6 +++---
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 4d543a7..34fed84 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -57,6 +57,7 @@
 #include <rte_alarm.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
+#include <rte_ethdev_pci.h>
 #include <rte_atomic.h>
 #include <rte_malloc.h>
 #include <rte_random.h>
@@ -1039,17 +1040,25 @@ static int eth_cxgbe_dev_init(struct rte_eth_dev 
*eth_dev)
        return err;
 }
 
-static struct eth_driver rte_cxgbe_pmd = {
-       .pci_drv = {
-               .id_table = cxgb4_pci_tbl,
-               .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
-               .probe = rte_eth_dev_pci_probe,
-               .remove = rte_eth_dev_pci_remove,
-       },
-       .eth_dev_init = eth_cxgbe_dev_init,
-       .dev_private_size = sizeof(struct port_info),
+static int eth_cxgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
+       struct rte_pci_device *pci_dev)
+{
+       return rte_eth_dev_pci_generic_probe(pci_dev,
+               sizeof(struct port_info), eth_cxgbe_dev_init);
+}
+
+static int eth_cxgbe_pci_remove(struct rte_pci_device *pci_dev)
+{
+       return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
+}
+
+static struct rte_pci_driver rte_cxgbe_pmd = {
+       .id_table = cxgb4_pci_tbl,
+       .drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_INTR_LSC,
+       .probe = eth_cxgbe_pci_probe,
+       .remove = eth_cxgbe_pci_remove,
 };
 
-RTE_PMD_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd.pci_drv);
+RTE_PMD_REGISTER_PCI(net_cxgbe, rte_cxgbe_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_cxgbe, cxgb4_pci_tbl);
 RTE_PMD_REGISTER_KMOD_DEP(net_cxgbe, "* igb_uio | uio_pci_generic | vfio");
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index 37b6090..2f9e12c 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -1641,7 +1641,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct 
sge_rspq *iq, bool fwevtq,
        iq->size = cxgbe_roundup(iq->size, 16);
 
        snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                eth_dev->driver->pci_drv.driver.name,
+                eth_dev->data->drv_name,
                 fwevtq ? "fwq_ring" : "rx_ring",
                 eth_dev->data->port_id, queue_id);
        snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);
@@ -1694,7 +1694,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct 
sge_rspq *iq, bool fwevtq,
                fl->size = cxgbe_roundup(fl->size, 8);
 
                snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                        eth_dev->driver->pci_drv.driver.name,
+                        eth_dev->data->drv_name,
                         fwevtq ? "fwq_ring" : "fl_ring",
                         eth_dev->data->port_id, queue_id);
                snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);
@@ -1890,7 +1890,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct 
sge_eth_txq *txq,
        nentries = txq->q.size + s->stat_len / sizeof(struct tx_desc);
 
        snprintf(z_name, sizeof(z_name), "%s_%s_%d_%d",
-                eth_dev->driver->pci_drv.driver.name, "tx_ring",
+                eth_dev->data->drv_name, "tx_ring",
                 eth_dev->data->port_id, queue_id);
        snprintf(z_name_sw, sizeof(z_name_sw), "%s_sw_ring", z_name);
 
-- 
2.7.4

Reply via email to