Skip to content

Commit 9c3ef90

Browse files
jgunthorpejoergroedel
authored andcommitted
iommu/dart: Convert to domain_alloc_paging()
Since the IDENTITY and BLOCKED behaviors were moved to global statics all that remains is the paging domain. Rename to apple_dart_attach_dev_paging() and remove the left over type check. Reviewed-by: Janne Grunau <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]> Acked-by: Sven Peter <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent 17ef8d6 commit 9c3ef90

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/iommu/apple-dart.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -651,8 +651,8 @@ static int apple_dart_domain_add_streams(struct apple_dart_domain *domain,
651651
true);
652652
}
653653

654-
static int apple_dart_attach_dev(struct iommu_domain *domain,
655-
struct device *dev)
654+
static int apple_dart_attach_dev_paging(struct iommu_domain *domain,
655+
struct device *dev)
656656
{
657657
int ret, i;
658658
struct apple_dart_stream_map *stream_map;
@@ -748,13 +748,10 @@ static void apple_dart_release_device(struct device *dev)
748748
kfree(cfg);
749749
}
750750

751-
static struct iommu_domain *apple_dart_domain_alloc(unsigned int type)
751+
static struct iommu_domain *apple_dart_domain_alloc_paging(struct device *dev)
752752
{
753753
struct apple_dart_domain *dart_domain;
754754

755-
if (type != IOMMU_DOMAIN_DMA && type != IOMMU_DOMAIN_UNMANAGED)
756-
return NULL;
757-
758755
dart_domain = kzalloc(sizeof(*dart_domain), GFP_KERNEL);
759756
if (!dart_domain)
760757
return NULL;
@@ -975,7 +972,7 @@ static void apple_dart_get_resv_regions(struct device *dev,
975972
static const struct iommu_ops apple_dart_iommu_ops = {
976973
.identity_domain = &apple_dart_identity_domain,
977974
.blocked_domain = &apple_dart_blocked_domain,
978-
.domain_alloc = apple_dart_domain_alloc,
975+
.domain_alloc_paging = apple_dart_domain_alloc_paging,
979976
.probe_device = apple_dart_probe_device,
980977
.release_device = apple_dart_release_device,
981978
.device_group = apple_dart_device_group,
@@ -985,7 +982,7 @@ static const struct iommu_ops apple_dart_iommu_ops = {
985982
.pgsize_bitmap = -1UL, /* Restricted during dart probe */
986983
.owner = THIS_MODULE,
987984
.default_domain_ops = &(const struct iommu_domain_ops) {
988-
.attach_dev = apple_dart_attach_dev,
985+
.attach_dev = apple_dart_attach_dev_paging,
989986
.map_pages = apple_dart_map_pages,
990987
.unmap_pages = apple_dart_unmap_pages,
991988
.flush_iotlb_all = apple_dart_flush_iotlb_all,

0 commit comments

Comments
 (0)