dev_vfio_get_device_num() was added together with VFIO cdev mode and
never had a caller; the cdev path resolves the device number itself.

Remove the function and its declaration.

Fixes: d129414711aa ("vfio: introduce cdev mode")

Signed-off-by: Stephen Hemminger <[email protected]>
---
 lib/eal/linux/eal_vfio.c         | 34 --------------------------------
 lib/eal/linux/include/dev_vfio.h | 25 -----------------------
 2 files changed, 59 deletions(-)

diff --git a/lib/eal/linux/eal_vfio.c b/lib/eal/linux/eal_vfio.c
index 8f832ff1e4..f733f9bad6 100644
--- a/lib/eal/linux/eal_vfio.c
+++ b/lib/eal/linux/eal_vfio.c
@@ -1481,40 +1481,6 @@ dev_vfio_get_group_num(const char *sysfs_base, const 
char *dev_addr, int *iommu_
        return 0;
 }
 
-RTE_EXPORT_INTERNAL_SYMBOL(dev_vfio_get_device_num)
-int
-dev_vfio_get_device_num(const char *sysfs_base, const char *dev_addr, int 
*device_num)
-{
-       int ret;
-
-       if (sysfs_base == NULL || dev_addr == NULL || device_num == NULL) {
-               rte_errno = EINVAL;
-               return -1;
-       }
-
-       if (vfio_global_cfg.mode == DEV_VFIO_MODE_NONE) {
-               EAL_LOG(ERR, "VFIO support not initialized");
-               rte_errno = ENXIO;
-               return -1;
-       }
-
-       if (vfio_global_cfg.mode != DEV_VFIO_MODE_CDEV) {
-               EAL_LOG(ERR, "VFIO not initialized in cdev mode");
-               rte_errno = ENOTSUP;
-               return -1;
-       }
-
-       ret = vfio_cdev_get_device_num(sysfs_base, dev_addr, device_num);
-       if (ret < 0) {
-               rte_errno = EINVAL;
-               return -1;
-       } else if (ret == 0) {
-               rte_errno = ENODEV;
-               return -1;
-       }
-       return 0;
-}
-
 static int
 vfio_dma_mem_map(struct vfio_container *cfg, uint64_t vaddr, uint64_t iova, 
uint64_t len,
                int do_map)
diff --git a/lib/eal/linux/include/dev_vfio.h b/lib/eal/linux/include/dev_vfio.h
index c018079ba7..e057fa6c08 100644
--- a/lib/eal/linux/include/dev_vfio.h
+++ b/lib/eal/linux/include/dev_vfio.h
@@ -240,31 +240,6 @@ __rte_internal
 int
 dev_vfio_get_group_num(const char *sysfs_base, const char *dev_addr, int 
*iommu_group_num);
 
-/**
- * @internal
- * Parse VFIO cdev device number for a device.
- *
- * @param sysfs_base
- *   Sysfs path prefix.
- * @param dev_addr
- *   Device identifier.
- * @param vfio_device_num
- *   Pointer to where VFIO cdev device number will be stored.
- *
- * @return
- *   0 on success.
- *   <0 on failure, rte_errno is set.
- *
- * Possible rte_errno values include:
- * - ENODEV  - Device not managed by VFIO.
- * - EINVAL  - Invalid parameters.
- * - ENXIO   - VFIO support not initialized.
- * - ENOTSUP - Unsupported VFIO mode.
- */
-__rte_internal
-int
-dev_vfio_get_device_num(const char *sysfs_base, const char *dev_addr, int 
*vfio_device_num);
-
 /**
  * @internal
  * Get device information.
-- 
2.53.0

Reply via email to