Skip to content

Commit f7f9c05

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu: Remove iommu_group_get_by_id()
This is never called. Signed-off-by: Jason Gunthorpe <[email protected]> Reviewed-by: Robin Murphy <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent e223864 commit f7f9c05

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

drivers/iommu/iommu.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -882,35 +882,6 @@ struct iommu_group *iommu_group_alloc(void)
882882
}
883883
EXPORT_SYMBOL_GPL(iommu_group_alloc);
884884

885-
struct iommu_group *iommu_group_get_by_id(int id)
886-
{
887-
struct kobject *group_kobj;
888-
struct iommu_group *group;
889-
const char *name;
890-
891-
if (!iommu_group_kset)
892-
return NULL;
893-
894-
name = kasprintf(GFP_KERNEL, "%d", id);
895-
if (!name)
896-
return NULL;
897-
898-
group_kobj = kset_find_obj(iommu_group_kset, name);
899-
kfree(name);
900-
901-
if (!group_kobj)
902-
return NULL;
903-
904-
group = container_of(group_kobj, struct iommu_group, kobj);
905-
BUG_ON(group->id != id);
906-
907-
kobject_get(group->devices_kobj);
908-
kobject_put(&group->kobj);
909-
910-
return group;
911-
}
912-
EXPORT_SYMBOL_GPL(iommu_group_get_by_id);
913-
914885
/**
915886
* iommu_group_get_iommudata - retrieve iommu_data registered for a group
916887
* @group: the group

include/linux/iommu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ extern bool iommu_present(struct bus_type *bus);
460460
extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap);
461461
extern bool iommu_group_has_isolated_msi(struct iommu_group *group);
462462
extern struct iommu_domain *iommu_domain_alloc(struct bus_type *bus);
463-
extern struct iommu_group *iommu_group_get_by_id(int id);
464463
extern void iommu_domain_free(struct iommu_domain *domain);
465464
extern int iommu_attach_device(struct iommu_domain *domain,
466465
struct device *dev);
@@ -746,11 +745,6 @@ static inline struct iommu_domain *iommu_domain_alloc(struct bus_type *bus)
746745
return NULL;
747746
}
748747

749-
static inline struct iommu_group *iommu_group_get_by_id(int id)
750-
{
751-
return NULL;
752-
}
753-
754748
static inline void iommu_domain_free(struct iommu_domain *domain)
755749
{
756750
}

0 commit comments

Comments
 (0)