diff mbox series

[4/5] backends/iommufd: Drop hiod_iommufd_get_cap()

Message ID 20250411101707.3460429-5-zhenzhong.duan@intel.com (mailing list archive)
State New
Headers show
Series cleanup interfaces | expand

Commit Message

Duan, Zhenzhong April 11, 2025, 10:17 a.m. UTC
Because sub-class TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO has it's own
implementation of .get_cap(), hiod_iommufd_get_cap() isn't used
any more, drop it.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
---
 backends/iommufd.c | 23 -----------------------
 1 file changed, 23 deletions(-)
diff mbox series

Patch

diff --git a/backends/iommufd.c b/backends/iommufd.c
index 54fa3174d0..d2ecdc9c82 100644
--- a/backends/iommufd.c
+++ b/backends/iommufd.c
@@ -311,28 +311,6 @@  bool iommufd_backend_get_device_info(IOMMUFDBackend *be, uint32_t devid,
     return true;
 }
 
-static int hiod_iommufd_get_cap(HostIOMMUDevice *hiod, int cap, Error **errp)
-{
-    HostIOMMUDeviceCaps *caps = &hiod->caps;
-
-    switch (cap) {
-    case HOST_IOMMU_DEVICE_CAP_IOMMU_TYPE:
-        return caps->type;
-    case HOST_IOMMU_DEVICE_CAP_AW_BITS:
-        return vfio_device_get_aw_bits(hiod->agent);
-    default:
-        error_setg(errp, "%s: unsupported capability %x", hiod->name, cap);
-        return -EINVAL;
-    }
-}
-
-static void hiod_iommufd_class_init(ObjectClass *oc, void *data)
-{
-    HostIOMMUDeviceClass *hioc = HOST_IOMMU_DEVICE_CLASS(oc);
-
-    hioc->get_cap = hiod_iommufd_get_cap;
-};
-
 static const TypeInfo types[] = {
     {
         .name = TYPE_IOMMUFD_BACKEND,
@@ -349,7 +327,6 @@  static const TypeInfo types[] = {
     }, {
         .name = TYPE_HOST_IOMMU_DEVICE_IOMMUFD,
         .parent = TYPE_HOST_IOMMU_DEVICE,
-        .class_init = hiod_iommufd_class_init,
         .abstract = true,
     }
 };