drivers: remove direct access to interrupt handle
[dpdk.git] / drivers / bus / ifpga / ifpga_bus.c
index 62887da..cbc6809 100644 (file)
@@ -161,6 +161,14 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
        afu_dev->id.uuid.uuid_high = 0;
        afu_dev->id.port      = afu_pr_conf.afu_id.port;
 
+       /* Allocate interrupt instance */
+       afu_dev->intr_handle =
+               rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
+       if (afu_dev->intr_handle == NULL) {
+               IFPGA_BUS_ERR("Failed to allocate intr handle");
+               goto end;
+       }
+
        if (rawdev->dev_ops && rawdev->dev_ops->dev_info_get)
                rawdev->dev_ops->dev_info_get(rawdev, afu_dev, sizeof(*afu_dev));
 
@@ -189,8 +197,10 @@ end:
                rte_kvargs_free(kvlist);
        if (path)
                free(path);
-       if (afu_dev)
+       if (afu_dev) {
+               rte_intr_instance_free(afu_dev->intr_handle);
                free(afu_dev);
+       }
 
        return NULL;
 }
@@ -396,6 +406,7 @@ ifpga_unplug(struct rte_device *dev)
        TAILQ_REMOVE(&ifpga_afu_dev_list, afu_dev, next);
 
        rte_devargs_remove(dev->devargs);
+       rte_intr_instance_free(afu_dev->intr_handle);
        free(afu_dev);
        return 0;