Skip to content

Commit 473ec07

Browse files
yiliu1765jgunthorpe
authored andcommitted
iommu: Drop iommu_group_replace_domain()
iommufd does not use it now, so drop it. Link: https://patch.msgid.link/r/[email protected] Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Nicolin Chen <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Signed-off-by: Yi Liu <[email protected]> Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 237603a commit 473ec07

File tree

2 files changed

+6
-32
lines changed

2 files changed

+6
-32
lines changed

drivers/iommu/iommu-priv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ static inline const struct iommu_ops *iommu_fwspec_ops(struct iommu_fwspec *fwsp
2424
return iommu_ops_from_fwnode(fwspec ? fwspec->iommu_fwnode : NULL);
2525
}
2626

27-
int iommu_group_replace_domain(struct iommu_group *group,
28-
struct iommu_domain *new_domain);
29-
3027
int iommu_device_register_bus(struct iommu_device *iommu,
3128
const struct iommu_ops *ops,
3229
const struct bus_type *bus,

drivers/iommu/iommu.c

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2187,32 +2187,6 @@ int iommu_attach_group(struct iommu_domain *domain, struct iommu_group *group)
21872187
}
21882188
EXPORT_SYMBOL_GPL(iommu_attach_group);
21892189

2190-
/**
2191-
* iommu_group_replace_domain - replace the domain that a group is attached to
2192-
* @group: IOMMU group that will be attached to the new domain
2193-
* @new_domain: new IOMMU domain to replace with
2194-
*
2195-
* This API allows the group to switch domains without being forced to go to
2196-
* the blocking domain in-between.
2197-
*
2198-
* If the currently attached domain is a core domain (e.g. a default_domain),
2199-
* it will act just like the iommu_attach_group().
2200-
*/
2201-
int iommu_group_replace_domain(struct iommu_group *group,
2202-
struct iommu_domain *new_domain)
2203-
{
2204-
int ret;
2205-
2206-
if (!new_domain)
2207-
return -EINVAL;
2208-
2209-
mutex_lock(&group->mutex);
2210-
ret = __iommu_group_set_domain(group, new_domain);
2211-
mutex_unlock(&group->mutex);
2212-
return ret;
2213-
}
2214-
EXPORT_SYMBOL_NS_GPL(iommu_group_replace_domain, "IOMMUFD_INTERNAL");
2215-
22162190
static int __iommu_device_set_domain(struct iommu_group *group,
22172191
struct device *dev,
22182192
struct iommu_domain *new_domain,
@@ -3558,9 +3532,12 @@ EXPORT_SYMBOL_NS_GPL(iommu_detach_group_handle, "IOMMUFD_INTERNAL");
35583532
* @new_domain: new IOMMU domain to replace with
35593533
* @handle: attach handle
35603534
*
3561-
* This is a variant of iommu_group_replace_domain(). It allows the caller to
3562-
* provide an attach handle for the new domain and use it when the domain is
3563-
* attached.
3535+
* This API allows the group to switch domains without being forced to go to
3536+
* the blocking domain in-between. It allows the caller to provide an attach
3537+
* handle for the new domain and use it when the domain is attached.
3538+
*
3539+
* If the currently attached domain is a core domain (e.g. a default_domain),
3540+
* it will act just like the iommu_attach_group_handle().
35643541
*/
35653542
int iommu_replace_group_handle(struct iommu_group *group,
35663543
struct iommu_domain *new_domain,

0 commit comments

Comments
 (0)