Skip to content

Commit f6440fc

Browse files
LuBaolujoergroedel
authored andcommitted
iommu: Remove iommu_domain_alloc()
The iommu_domain_alloc() interface is no longer used in the tree anymore. Remove it to avoid dead code. There is increasing demand for supporting multiple IOMMU drivers, and this is the last bus-based thing standing in the way of that. Signed-off-by: Lu Baolu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent ba1057a commit f6440fc

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

drivers/iommu/iommu.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1965,42 +1965,6 @@ __iommu_group_domain_alloc(struct iommu_group *group, unsigned int type)
19651965
return __iommu_domain_alloc(dev_iommu_ops(dev), dev, type);
19661966
}
19671967

1968-
static int __iommu_domain_alloc_dev(struct device *dev, void *data)
1969-
{
1970-
const struct iommu_ops **ops = data;
1971-
1972-
if (!dev_has_iommu(dev))
1973-
return 0;
1974-
1975-
if (WARN_ONCE(*ops && *ops != dev_iommu_ops(dev),
1976-
"Multiple IOMMU drivers present for bus %s, which the public IOMMU API can't fully support yet. You will still need to disable one or more for this to work, sorry!\n",
1977-
dev_bus_name(dev)))
1978-
return -EBUSY;
1979-
1980-
*ops = dev_iommu_ops(dev);
1981-
return 0;
1982-
}
1983-
1984-
/*
1985-
* The iommu ops in bus has been retired. Do not use this interface in
1986-
* new drivers.
1987-
*/
1988-
struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus)
1989-
{
1990-
const struct iommu_ops *ops = NULL;
1991-
int err = bus_for_each_dev(bus, NULL, &ops, __iommu_domain_alloc_dev);
1992-
struct iommu_domain *domain;
1993-
1994-
if (err || !ops)
1995-
return NULL;
1996-
1997-
domain = __iommu_domain_alloc(ops, NULL, IOMMU_DOMAIN_UNMANAGED);
1998-
if (IS_ERR(domain))
1999-
return NULL;
2000-
return domain;
2001-
}
2002-
EXPORT_SYMBOL_GPL(iommu_domain_alloc);
2003-
20041968
/**
20051969
* iommu_paging_domain_alloc() - Allocate a paging domain
20061970
* @dev: device for which the domain is allocated

include/linux/iommu.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,6 @@ static inline void iommu_iotlb_gather_init(struct iommu_iotlb_gather *gather)
787787
extern int bus_iommu_probe(const struct bus_type *bus);
788788
extern bool device_iommu_capable(struct device *dev, enum iommu_cap cap);
789789
extern bool iommu_group_has_isolated_msi(struct iommu_group *group);
790-
extern struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus);
791790
struct iommu_domain *iommu_paging_domain_alloc(struct device *dev);
792791
extern void iommu_domain_free(struct iommu_domain *domain);
793792
extern int iommu_attach_device(struct iommu_domain *domain,
@@ -1079,11 +1078,6 @@ static inline bool device_iommu_capable(struct device *dev, enum iommu_cap cap)
10791078
return false;
10801079
}
10811080

1082-
static inline struct iommu_domain *iommu_domain_alloc(const struct bus_type *bus)
1083-
{
1084-
return NULL;
1085-
}
1086-
10871081
static inline struct iommu_domain *iommu_paging_domain_alloc(struct device *dev)
10881082
{
10891083
return ERR_PTR(-ENODEV);

0 commit comments

Comments
 (0)