Skip to content

Commit 6632863

Browse files
LuBaolujoergroedel
authored andcommitted
iommu: Remove iommu_present()
The last callsite of iommu_present() is removed by commit <45c690aea8ee> ("drm/tegra: Use iommu_paging_domain_alloc()"). Remove it to avoid dead code. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Yi Liu <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 7fd9aeb commit 6632863

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

drivers/iommu/iommu.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,31 +1840,6 @@ int bus_iommu_probe(const struct bus_type *bus)
18401840
return 0;
18411841
}
18421842

1843-
/**
1844-
* iommu_present() - make platform-specific assumptions about an IOMMU
1845-
* @bus: bus to check
1846-
*
1847-
* Do not use this function. You want device_iommu_mapped() instead.
1848-
*
1849-
* Return: true if some IOMMU is present and aware of devices on the given bus;
1850-
* in general it may not be the only IOMMU, and it may not have anything to do
1851-
* with whatever device you are ultimately interested in.
1852-
*/
1853-
bool iommu_present(const struct bus_type *bus)
1854-
{
1855-
bool ret = false;
1856-
1857-
for (int i = 0; i < ARRAY_SIZE(iommu_buses); i++) {
1858-
if (iommu_buses[i] == bus) {
1859-
spin_lock(&iommu_device_lock);
1860-
ret = !list_empty(&iommu_device_list);
1861-
spin_unlock(&iommu_device_lock);
1862-
}
1863-
}
1864-
return ret;
1865-
}
1866-
EXPORT_SYMBOL_GPL(iommu_present);
1867-
18681843
/**
18691844
* device_iommu_capable() - check for a general IOMMU capability
18701845
* @dev: device to which the capability would be relevant, if available

include/linux/iommu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,6 @@ static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
785785
}
786786

787787
extern int bus_iommu_probe(const struct bus_type *bus);
788-
extern bool iommu_present(const struct bus_type *bus);
789788
extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap);
790789
extern bool iommu_group_has_isolated_msi(struct iommu_group *group);
791790
extern struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus);
@@ -1081,11 +1080,6 @@ struct iommu_iotlb_gather {};
10811080
struct iommu_dirty_bitmap {};
10821081
struct iommu_dirty_ops {};
10831082

1084-
static inline bool iommu_present(const struct bus_type *bus)
1085-
{
1086-
return false;
1087-
}
1088-
10891083
static inline bool device_iommu_capable(struct device *dev, enum iommu_cap cap)
10901084
{
10911085
return false;

0 commit comments

Comments
 (0)